472,353 Members | 1,353 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,353 software developers and data experts.

An unhandled exception of type 'System.Messaging.MessageQueueException' occurred

Hi,
I am trying to set up a VERY simple project to send message to MSMQ from
..Net using C#. When I run my code it throws an exception

"An unhandled exception of type 'System.Messaging.MessageQueueException'
occurred in system.messaging.dll"

I can only find one other link from Google (
http://www.dotnet247.com/247referen...s/14/73719.aspx )where this has
occured. Can someone help me out here. I find it hard to believe that apart
from myself only one other person has seen this issue.
Source Code:
public void SendMessageTransactional()
{
if (MessageQueue.Exists(@".\Private$\TestQueue"))
{
// Connect to a queue on the local computer.
MessageQueue myQueue = new MessageQueue(@".\Private$\TestQueue");

// Send a message to the queue.
if (myQueue.Transactional == true)
{
myQueue.Send("My Message Data.", "a Label");
return;
}
}
}

I can send messages to the queue from VB6, so the queue itself is fine. The
queue is private, absolutely nothing odd about it. I have created several
queues all the same result from dotnet.

Any help is greatly appreciated, this is very annoying
Nov 15 '05 #1
2 7256
Hi,

I have found that your code checks for message queue transactional mode
(myQueue.Transactional == true) but uses Send method without starting new
transaction. Try the following:

if (myQueue.Transactional == true)
{
using (MessageQueueTransaction trans = new MessageQueueTransaction())
{
trans.Begin();
myQueue.Send("My Message Data.", "a Label", trans);
trans.Commit();
}
return;
}

--
Andrew Gnenny
pulsar2003@/no-spam/email.ru (Please remove /no-spam/ for reply)
X-Unity Test Studio
http://x-unity.miik.com.ua/teststudio.aspx
Bring the power of unit testing to VS .NET IDE
"Tony Hamill" <an************@ntlworld.com1> wrote in message
news:O7**************@TK2MSFTNGP11.phx.gbl...
Hi,
I am trying to set up a VERY simple project to send message to MSMQ from
.Net using C#. When I run my code it throws an exception

"An unhandled exception of type 'System.Messaging.MessageQueueException'
occurred in system.messaging.dll"

I can only find one other link from Google (
http://www.dotnet247.com/247referen...s/14/73719.aspx )where this has
occured. Can someone help me out here. I find it hard to believe that apart from myself only one other person has seen this issue.
Source Code:
public void SendMessageTransactional()
{
if (MessageQueue.Exists(@".\Private$\TestQueue"))
{
// Connect to a queue on the local computer.
MessageQueue myQueue = new MessageQueue(@".\Private$\TestQueue");

// Send a message to the queue.
if (myQueue.Transactional == true)
{
myQueue.Send("My Message Data.", "a Label");
return;
}
}
}

I can send messages to the queue from VB6, so the queue itself is fine. The queue is private, absolutely nothing odd about it. I have created several
queues all the same result from dotnet.

Any help is greatly appreciated, this is very annoying

Nov 15 '05 #2
Andrew,
many thanks for this, that was the issue.

Tony.
"Andrew Gnenny" <pulsar2003@/no-spam/email.ru> wrote in message
news:3f********@nexus.validio.com.ua...
Hi,

I have found that your code checks for message queue transactional mode
(myQueue.Transactional == true) but uses Send method without starting new
transaction. Try the following:

if (myQueue.Transactional == true)
{
using (MessageQueueTransaction trans = new MessageQueueTransaction())
{
trans.Begin();
myQueue.Send("My Message Data.", "a Label", trans);
trans.Commit();
}
return;
}

--
Andrew Gnenny
pulsar2003@/no-spam/email.ru (Please remove /no-spam/ for reply)
X-Unity Test Studio
http://x-unity.miik.com.ua/teststudio.aspx
Bring the power of unit testing to VS .NET IDE
"Tony Hamill" <an************@ntlworld.com1> wrote in message
news:O7**************@TK2MSFTNGP11.phx.gbl...
Hi,
I am trying to set up a VERY simple project to send message to MSMQ from
.Net using C#. When I run my code it throws an exception

"An unhandled exception of type 'System.Messaging.MessageQueueException'
occurred in system.messaging.dll"

I can only find one other link from Google (
http://www.dotnet247.com/247referen...s/14/73719.aspx )where this has
occured. Can someone help me out here. I find it hard to believe that

apart
from myself only one other person has seen this issue.
Source Code:
public void SendMessageTransactional()
{
if (MessageQueue.Exists(@".\Private$\TestQueue"))
{
// Connect to a queue on the local computer.
MessageQueue myQueue = new MessageQueue(@".\Private$\TestQueue");

// Send a message to the queue.
if (myQueue.Transactional == true)
{
myQueue.Send("My Message Data.", "a Label");
return;
}
}
}

I can send messages to the queue from VB6, so the queue itself is fine.

The
queue is private, absolutely nothing odd about it. I have created several queues all the same result from dotnet.

Any help is greatly appreciated, this is very annoying


Nov 15 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Rafael | last post by:
Hi, I hope I can find some help for this problem IDE: Visual Studio.NET 2003 Developer Editio Language: C# Problem: "An unhandled exception of...
3
by: Professor Frink | last post by:
First off, I apologize if this gets long. I'm simply trying to give you all enough information to help me out. I'm writing (almost finished,...
0
by: Joe Bloggs | last post by:
I have a C# MRS application that uses the ReportingService's Render method to retrieve a byte array containing a report. The following error...
5
by: Paw Pedersen | last post by:
When I catch an exception I can see the NativeErrorCode when I'm debugging through the code, but how do I get this programatically? I need to check...
1
by: Ramanfromoz | last post by:
Hi, Developing a new we application. Everything okay on my local WIN XP PROFESSIONAL, IIS 5.0 running locally. The website is running smoothly. ...
4
by: Craig831 | last post by:
First off, I apologize if this gets long. I'm simply trying to give you all enough information to help me out. I'm writing (almost finished,...
2
by: Ed Crowley | last post by:
I have the following code: Dim BuilderForm As frmBuilder BuilderForm = New frmBuilder(_LastChangedFile.Path) BuilderForm.Refresh() ...
9
by: Supra | last post by:
i got error problem.......... An unhandled exception of type 'System.NullReferenceException' occurred in system.windows.forms.dll Additional...
1
by: =?Utf-8?B?Wmlub24=?= | last post by:
Hello I have an ASP.NET 2 intranet application written in C#. I use Active Directory authentication and parts of the application uses AJAX. ...
1
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge...
0
jalbright99669
by: jalbright99669 | last post by:
Am having a bit of a time with URL Rewrite. I need to incorporate http to https redirect with a reverse proxy. I have the URL Rewrite rules made...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...
0
by: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the...
0
BLUEPANDA
by: BLUEPANDA | last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS...
0
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.