[英]The type or namespace name 'ServiceBus' does not exist in the namespace 'Microsoft'
I'm trying to make a C# console app that adds messages to a queue. 我正在尝试制作一个将消息添加到队列的C#控制台应用程序。 I'm following the examples about Azure Service Bus given here: http://www.windowsazure.com/en-us/develop/net/how-to-guides/service-bus-queues/
我正在关注这里给出的Azure Service Bus示例: http : //www.windowsazure.com/en-us/develop/net/how-to-guides/service-bus-queues/
My program does nothing at the moment: 我的程序目前什么都不做:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.ServiceBus;
using Microsoft.ServiceBus.Messaging;
namespace testConsole
{
class Program
{
static void Main(string[] args)
{
}
}
}
The problem I'm having is that when I add the Microsoft.ServiceBus.dll reference (as explained in the above link, 1-add dll reference and 2-add using statements) I'm getting an error upon compiling: " The type or namespace name 'ServiceBus' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?) " 我遇到的问题是,当我添加Microsoft.ServiceBus.dll引用时(如上面链接中所述,1-add dll reference和2-add using statements)我在编译时遇到错误:“ 类型名称空间'Microsoft'中不存在名称空间名称'ServiceBus'(您是否缺少程序集引用?) “
I even looked into the Microsoft.ServiceBus.dll with reflector tool and it does contain Microsoft.ServiceBus namespace. 我甚至使用反射器工具查看了Microsoft.ServiceBus.dll,它确实包含Microsoft.ServiceBus命名空间。 Version number of the dll is 1.6.0.0 and runtime version v4.0.30319.
dll的版本号为1.6.0.0,运行时版本为v4.0.30319。
Any help appreciated. 任何帮助赞赏。
-pom- -pom-
A common issue when using Storage and AppFabric services with a non-web applications is that the default Target Framework for Windows Forms app and Console App is .NET Framework 4.0 Client Profile. 将Storage和AppFabric服务与非Web应用程序一起使用时的一个常见问题是,Windows窗体应用程序和控制台应用程序的默认目标框架是.NET Framework 4.0 Client Profile。 Change your project's Target Framework to ".NET Framework 4.0" (full) and it will work.
将项目的Target Framework更改为“.NET Framework 4.0”(完整版),它将起作用。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.