Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?)"

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.

Any help appreciated.

-pom-

like image 977
Pompair Avatar asked Dec 19 '11 13:12

Pompair


1 Answers

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.

like image 169
astaykov Avatar answered Oct 05 '22 19:10

astaykov