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

Fails to create ZContext under .net Core 3.0 #178

Closed vsharma-weedenprime closed 4 years ago

vsharma-weedenprime commented 5 years ago

System.TypeInitializationException HResult=0x80131534 Message=The type initializer for 'ZeroMQ.lib.zmq' threw an exception. Source=ZeroMQ StackTrace: at ZeroMQ.ZContext..ctor() at MDSTestClient.Program.Main(String[] args) in C:\Users\vsharma\OneDrive - Weeden Prime\source\MarketDataService\MDSTestClient\MDSTestClient\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.

mkermit commented 4 years ago

+1 not able to use with .net core 3.0. Are any plans to fix the issue? thanks

cezarypiatekGC commented 4 years ago

This is caused by the fact that ZeroMQ.ZSymbol.PickupConstantSymbols is trying to set readonly fields on ZeroMQ,ZError using reflection. In dotnet core 3.0 it's not possible anymore. The fix seems to be quite straightforward by removing readonly keyword, but I have two questions:

valbers commented 3 years ago

can you please release a patch version with this commit inside? Thank you.

steveocrypto commented 3 years ago

Can you please release a patch on this? Could really use it on a .Net 3.1 build.

TYoungSL commented 3 years ago

the heck

MarcAzar commented 7 months ago

Still an issue using ZeroMQ V4.1.0.31 on .Net 7

cezarypiatekGC commented 7 months ago

This project seems to be dead. I would recommend migrating your projects to NetMQ (ZeroMq fully implemented in C# without native dependencies)

https://github.com/zeromq/netmq