zeromq / clrzmq4

ZeroMQ C# namespace (.NET and mono, Windows, Linux and MacOSX, x86 and amd64)
GNU Lesser General Public License v3.0
241 stars 112 forks source link

Nuget package with version that supports netstandard2.0 #182

Open cezarypiatekGC opened 5 years ago

cezarypiatekGC commented 5 years ago

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.

mkermit commented 4 years ago

Any news on that? thanks

kwinz commented 3 years ago

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

fuglede commented 3 years ago

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
glopesdev commented 3 years ago

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.