安装了NuGet pkg ZeroMQ 4.1.0.17(运行时版本v4.0.30319;版本4.1.0.42169)的C#代码。在Visual Studio工作区中运行良好,但在与ZeroMQ.dll相同的目录中部署.exe时,以及包含libzmq.dll和libsodium.dll的amd64子目录 - 甚至包含复制的副本进入与程序和ZeroMQ.dll相同的exec目录 - 我们得到:
Connect System.TypeInitializationException: The type initializer for 'ZeroMQ.lib.zmq' threw an exception. ---> System.IO.FileNotFoundException: UnmanagedLibrary[libzmq] Unable to load library "libzmq" from "C:\Windows\TEMP\libzmq.dll". Inspect Trace output for details. ---> System.IO.FileNotFoundException: The system cannot find the file specified. (Exception from HRESULT: 0x80070002)
--- End of inner exception stack trace ---
at ZeroMQ.lib.Platform.Win32.LoadUnmanagedLibrary(String libraryName)
at ZeroMQ.lib.zmq..cctor()
--- End of inner exception stack trace ---
at ZeroMQ.ZContext..ctor()
at Core.Adapter.ZeroMQ.ZeroMQMessagingService.Connect(String connection_string) in \ZeroMQMessagingService.cs:line 201
请注意,它表示它正在查看C:\ Windows \ TEMP,但也许这只是链中的最后一个位置。
我们在升级到ZeroMQ 4.1.0.21并且未能将libzmq.dll作为“嵌入式资源”加载后得到这个,所以我们完全删除了.21并返回到.17。在我们升级到.21之前,它在.17中工作正常。
复制如果在amd64 \ libzmq.dll和libsodium.dll上选中了Newer,是的,这是一个试图在x64机器上运行的x64版本。失败的主机是2012 Server运行.NET 4.5。
答案 0 :(得分:3)
事实证明这很简单。我们正在转向仍在配置的新机器,并且安装C ++ 2010可再发行组件为我们解决了这个问题。