错误-使用zeroMQ的C#语言的Visual studio 2017社区找不到libzmq或libmq

错误-使用zeroMQ的C#语言的Visual studio 2017社区找不到libzmq或libmq,c#,visual-studio,windows-7,zeromq,C#,Visual Studio,Windows 7,Zeromq,在Win7上使用VS2017社区,最新版本,最新版本,在创建hwclient C#程序时,将nuget zeroMQ包“Install package zeroMQ-Version 4.1.0.27”用于project作为windows窗体成功编译 运行时-出现以下错误:zeroMQ.lib找不到libzmq.dll,或者libzmq.dll不是有效的windows dll,并且也找不到libzmq.dll。当需要ZContext时,该错误被捕获在zeroMQ.dll中 该项目仅使用一个nuge

在Win7上使用VS2017社区,最新版本,最新版本,在创建hwclient C#程序时,将nuget zeroMQ包“Install package zeroMQ-Version 4.1.0.27”用于project作为windows窗体成功编译

运行时-出现以下错误:zeroMQ.lib找不到libzmq.dll,或者libzmq.dll不是有效的windows dll,并且也找不到libzmq.dll。当需要ZContext时,该错误被捕获在zeroMQ.dll中

该项目仅使用一个nuget包ZeroMQ,因此无法访问其他资源,否则为其提供一个整洁的nuget包有什么意义(这不是问题-只是如何解决缺少dll的问题)


您是否尝试过使用NetMQ?没有这个问题项目设置是什么?您是否使用X86和任何CPU?看起来它正在寻找一个旧的386 dll。我认为你不能直接从c#调用386 dll。必须调用C++包装器来执行386 DLL。所以ZrOMQ包必须调用C++包装器,然后调用提供例外的DLL。BrADLYDOTNET——是的,也尝试过NETMQ和相同的问题。JDWEN——在VS2017上,它不再扩展DLL,因为你指定了目标平台——我通常只瞄准x86,但是也尝试了AnyCPU,x64和x86的效果相同。“386”、x86、amd64是VS内部搜索模式:即使是从其他地方获得的dll,dependens.exe已被选中,放置在早期目录中,并且regsvr32’ed仍然无法看到它们。ZrOMQ NuGeCuxy的全部点是C++调用已经被包在C*O-中,根据ZrOMQ文档和示例。问题在于提取/缺少dll。NetMQ不能产生与不使用libzmq相同的问题,它是zeromq到c#的纯端口。使用NetMQ时,您不能使用相同的代码,因为它是与ZeroMQ兼容的另一个库。您是否尝试过使用NetMQ?没有这个问题项目设置是什么?您是否使用X86和任何CPU?看起来它正在寻找一个旧的386 dll。我认为你不能直接从c#调用386 dll。必须调用C++包装器来执行386 DLL。所以ZrOMQ包必须调用C++包装器,然后调用提供例外的DLL。BrADLYDOTNET——是的,也尝试过NETMQ和相同的问题。JDWEN——在VS2017上,它不再扩展DLL,因为你指定了目标平台——我通常只瞄准x86,但是也尝试了AnyCPU,x64和x86的效果相同。“386”、x86、amd64是VS内部搜索模式:即使是从其他地方获得的dll,dependens.exe已被选中,放置在早期目录中,并且regsvr32’ed仍然无法看到它们。ZrOMQ NuGeCuxy的全部点是C++调用已经被包在C*O-中,根据ZrOMQ文档和示例。问题在于提取/缺少dll。NetMQ不能产生与不使用libzmq相同的问题,它是zeromq到c#的纯端口。使用NetMQ时,不能使用相同的代码,因为它是与zeromq兼容的另一个库
using System;
using System.Net;
using System.Windows.Forms;
using ZeroMQ;
namespace InterComm
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
            string strHostName = "";
            strHostName = System.Net.Dns.GetHostName();
            IPHostEntry ipEntry = System.Net.Dns.GetHostEntry(strHostName);
            IPAddress[] addr = ipEntry.AddressList;
            lblMyIPString.Text = addr[1].ToString();
        }
        private void btnHello_Click(object sender, EventArgs e)
        {
            string endpoint = "tcp://" + tbTheirIP.Text + ":5555";
            using (var context = new ZContext()) <- ERROR
            {
                using (var requester = new ZSocket(context, SocketType.REQ))
                {
                    requester.Connect(endpoint);
                    for (int n = 0; n < 3; ++n)
                    {
                        string requestText = "Hello";
                        rtbResponse.Text.Insert(0, "Sending... " + requestText);
                        requester.Send(new ZFrame(requestText));
                        using (ZFrame reply = requester.ReceiveFrame())
                        {
                            string resp = reply.ReadString();
                            if (resp.Length == 0)
                            {
                                rtbResponse.Text.Insert(0, "Silence from : "+ lblTheirIP.Text); 
                            }
                                else
                            {
                                rtbResponse.Text.Insert(0, "Received: " + reply.ReadString());
                            }
                        }
                    }
                }
            }
        }
    }
}
InterComm.exe Warning: 0 : UnmanagedLibrary[libsodium] Unable to extract the 
EmbeddedResource "ZeroMQ.libsodium.i386.dll" to 
"C:\Users\techuser\AppData\Local\Temp\ZeroMQ.libsodium.i386.dll".
InterComm.exe Warning: 0 : UnmanagedLibrary[libzmq] Unable to extract the EmbeddedResource "ZeroMQ.libzmq.i386.dll" to "C:\Users\techuser\AppData\Local\Temp\ZeroMQ.libzmq.i386.dll".
Exception thrown: 'System.TypeInitializationException' in ZeroMQ.dll
An unhandled exception of type 'System.TypeInitializationException' occurred in ZeroMQ.dll
The type initializer for 'ZeroMQ.lib.zmq' threw an exception.