类型或命名空间名称'ServiceBus'不命名空间中存在的'微软' [英] The type or namespace name 'ServiceBus' does not exist in the namespace 'Microsoft'

查看:363
本文介绍了类型或命名空间名称'ServiceBus'不命名空间中存在的'微软'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图做一个C#控制台应用程序,增加了消息队列。我在下面这里给出关于Azure的服务总线的例子:<一href=\"http://www.windowsazure.com/en-us/develop/net/how-to-guides/service-bus-queues/\">http://www.windowsazure.com/en-us/develop/net/how-to-guides/service-bus-queues/

I'm trying to make a C# console app that adds messages to a queue. 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/

我的程序什么也不做的时刻:

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)
        {
        }
    }
}

我遇到的问题是,当我加入Microsoft.ServiceBus.dll引用(如上面的链接解释,1 - 添加DLL引用,并用语句2加)编译时,我得到一个错误: 类型或命名空间名称'ServiceBus'不存在命名空间'微软'存在(是否缺少程序集引用?)

我连进去看了Microsoft.ServiceBus.dll与反射器的工具,它确实包含Microsoft.ServiceBus命名空间。该DLL的版本号为1.6.0.0和运行时版本v4.0.30319。

I even looked into the Microsoft.ServiceBus.dll with reflector tool and it does contain Microsoft.ServiceBus namespace. Version number of the dll is 1.6.0.0 and runtime version v4.0.30319.

任何帮助AP preciated。

Any help appreciated.

-pom -

推荐答案

使用Storage和AppFabric的服务与非Web应用程序时是默认的目标框架为Windows窗体应用程序和控制台应用程序是.NET框架4.0的一个共同问题客户端配置文件。更改项目的目标框架.NET框架4.0(全),它会正常工作。

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. Change your project's Target Framework to ".NET Framework 4.0" (full) and it will work.

这篇关于类型或命名空间名称'ServiceBus'不命名空间中存在的'微软'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆