clrzmq4 icon indicating copy to clipboard operation
clrzmq4 copied to clipboard

Nuget package with version that supports netstandard2.0

Open cezarypiatekGC opened this issue 4 years ago • 4 comments

Hi,

Are there any plans for releasing nuget package with clrzmq4 that contains library targeting netstandard2.0? As I'm aware of, the process of porting to netstandard2.0 is finished but currently released nuget only contains version for net40.

cezarypiatekGC avatar Jul 22 '19 11:07 cezarypiatekGC

Any news on that? thanks

mkermit avatar Oct 09 '19 09:10 mkermit

No reply for a year? Is this project still maintained?

kwinz avatar Nov 01 '20 20:11 kwinz

For anybody else looking for a workaround, here's what I did to get set up with a usable NuGet package for .NET Standard 2.0 on x64 (ignoring all other platforms, which accidentally has the nice benefit of making builds a good deal smaller):

  1. In ZeroMQ.netcore.csproj, define a PackageId of SomePrefix.ZeroMQ (to avoid naming conflicts with the existing package) and an appropriate version number (I just used 4.1.0.31 for consistency).
  2. In ZeroMQ.nuspec, change the id property to SomePrefix.ZeroMQ, and change the files section to the following:
<file src="ZeroMQ.targets" target="build\netstandard2.0\SomePrefix.ZeroMQ.targets" />
<file src="bin\Release\netstandard2.0\ZeroMQ.dll" target="lib\netstandard2.0" />
<file src="libzmq.dll" target="build\libzmq.dll" />
  1. Include amd64/libzmq.dll from the existing NuGet package in the root of the repository (cf. the final file above).
  2. Change ZeroMQ.targets to the following, to ensure that libzmq.dll ends up in the right place after building (cf. #180).
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <Target Name="AfterBuild">
    <Copy
      SourceFiles="$(MSBuildThisFileDirectory)..\libzmq.dll"
      DestinationFolder="$(TargetDir)"
      />
  </Target>
</Project>
  1. Then, the NuGet package can be built through
dotnet build ZeroMQ.netcore.csproj -c Release
nuget pack ZeroMQ.nuspec

fuglede avatar Mar 03 '21 20:03 fuglede

This should be fixed together with #206 to ensure that the runtime identifier folders are used to distribute the native binaries, as per the .NET RID Catalog.

glopesdev avatar Jun 15 '21 09:06 glopesdev