473,395 Members | 1,647 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 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 7420
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 type 'System.NullReferenceException' occurred in...
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, actually), my first VB.Net application. It's a forms...
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 message occurs An unhandled exception of type...
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 if the exception I catch is with nativeErrorCode...
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. Now, the same code I am copying over to a...
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, actually), my first VB.Net application. It's a forms...
2
by: Ed Crowley | last post by:
I have the following code: Dim BuilderForm As frmBuilder BuilderForm = New frmBuilder(_LastChangedFile.Path) BuilderForm.Refresh() BuilderForm.ShowDialog() And get the following...
9
by: Supra | last post by:
i got error problem.......... An unhandled exception of type 'System.NullReferenceException' occurred in system.windows.forms.dll Additional information: Object reference not set to an instance of...
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. From time to time (about once every 200-300 accesses...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.