System.Messaging?

H

Hai Nguyen

Hello everyone
I'm trying to use the namespace using System.Messaging. My Visual Studio.Net
could not recognize this namespace. Should I have to install a plug in or
what should I do to have this piece of demo works

public class MQSend
{

public static void Main(String[] args)

{

string appName = Environment.GetCommandLineArgs()[0];

if(args.Length != 2)

{

Console.WriteLine("Usage: " + appName +" <queue> <message>");

}

else

{

string mqPath = ".\\" + args[0];

if(!MessageQueue.Exists(mqPath))

{

MessageQueue.Create(mqPath);

}

MessageQueue mq = new MessageQueue(mqPath);

mq.Send(args[1]);

}

Console.WriteLine();

Console.WriteLine("Press Enter to continue...");

Console.ReadLine();

}

}
 
I

Ignacio Machin \( .NET/ C# MVP \)

Hi,

You have to add a reference to it:
From menu:
Project/Add reference and search System.Messaging.dll in the list

You can do a similar thing using Right click over "References" in the
project explorer

Cheers,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top