ZeroMQ use with .net core

1

Is it possible to use ZeroMQ (version 4.1.0.31) in a .NET core project? It seems that is targeted only for .NET framework. If I download the package from nuget and try to initialise a ZContext it throws an exception.

System.TypeInitializationException
HResult=0x80131534
Message=The type initializer for 'ZeroMQ.lib.zmq' threw an exception.
Source=ZeroMQ
StackTrace:
at ZeroMQ.ZContext..ctor()
at TestClient.Program.Main(String[] args) in Program.cs:line 2521

Inner Exception 1:
TypeInitializationException: The type initializer for 'ZeroMQ.ZSymbol' threw an exception.

Inner Exception 2:
FieldAccessException: Cannot set initonly static field 'EPERM' after type 'ZeroMQ.ZError' is initialized.
c#
zeromq
asked on Stack Overflow Oct 9, 2019 by Michalis • edited Oct 9, 2019 by Michalis

1 Answer

0

It looks like the maintainer has done work to port it to .NET Standard, but has not yet released it. See this issue.

The latest release on GitHub was made after the changes to support .NET Standard, so using that instead of the NuGet package should work. I was able to reference bin/Release/ZeroMQ.dll from a .NET Core project.

answered on Stack Overflow Oct 9, 2019 by canton7 • edited Oct 9, 2019 by canton7

User contributions licensed under CC BY-SA 3.0