clrzmq
clrzmq copied to clipboard
Possible .net 4.5 influence on clrzmq 3.0.0.0
We have found a problem running clrzmq 3.0.0.0 on .net 4.0 runtime. When making .Net calls inside of the ZmqSocket ReceiveReady event, we get the stack trace shown below. This problem goes away when we install .Net 4.5 on the system, even though clrzmq.dll was built on .net 4.0.30319. Some research indicates that this can be caused by building on a system with .Net 4.5 installed. Can you please check the build machine for this condition, and consider releasing a NuGet update that fixes this issue, if it is indeed the case?
Thanks and Regards, Lyle
System.TypeLoadException: Could not load type 'System.Runtime.CompilerServices.ExtensionAttribute' from assembly 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'. at System.ModuleHandle.ResolveType(RuntimeModule module, Int32 typeToken, IntPtr* typeInstArgs, Int32 typeInstCount, IntPtr* methodInstArgs, Int32 methodInstCount, ObjectHandleOnStack type)
I can confirm this exact same error. It occurs for me when loading an ASP.NET page that uses a class referencing ZeroMQ, and intermittently goes away and appears. It is reliably reproducible after an iisreset and a clean refresh of the offending page.
We are also hitting this problem with clrzmq 3.0.0.0 on .NET 4.0 and would love to have a solution besides "maintain our own version".
To reproduce, get a reference to the clrzmq assembly on a system which does not have .NET 4.5 installed on it and attempt to retrieve the custom attributes on the assembly.
foreach (System.Reflection.Assembly a in AppDomain.CurrentDomain.GetAssemblies())
{
try
{
object[] attrs = a.GetCustomAttributes(false);
}
catch (Exception e)
{
Console.WriteLine(e);
throw;
}
}