【发布时间】:2013-03-17 13:43:32
【问题描述】:
场景:一旦 Node.js 服务器在 tcp://127.0.0.1:2202 上监听 ZeroMQ。并且数据必须由 C# 控制台应用程序发送。
using System;
using System.Text;
using ZMQ;
namespace ZMQGuide
{
class Program
{
static void Main(string[] args)
{
// ZMQ Context and client socket
using (ZmqContext context = ZmqContext.Create())
using (ZmqSocket client = context.CreateSocket(SocketType.PUSH))
{
client.Connect("tcp://127.0.0.1:2202");
string request = "Hello";
for (int requestNum = 0; requestNum < 10; requestNum++)
{
Console.WriteLine("Sending request {0}...", requestNum);
client.Send(request, Encoding.Unicode);
string reply = client.Receive(Encoding.Unicode);
Console.WriteLine("Received reply {0}: {1}", requestNum, reply);
}
}
}
}
}
出现以下错误:
Error 1 The type or namespace name 'ZmqContext' could not be found (are you missing a using directive or an assembly reference?) D:\..\Program.cs 26 24 PROJECTA
信息:我尝试通过发出命令PM> Install-Package clrzmq 使用包管理器控制台安装最新版本
命令后的输出:
'clrzmq 2.2.5' already installed.
Successfully added 'clrzmq 2.2.5' to PROJECTA.
问题:谁能告诉我,我哪里出错了或者我错过了什么?
更新:我有 downloaded 并尝试过,但没有运气 :-)
提前感谢您的大力帮助
【问题讨论】:
标签: c# .net clr zeromq package-managers