Search

MsmqException (0xC00E0051) 60 seconds after a WCF Service is executed by Jorge Fioranelli

Resolved
as Deferred Help for as Deferred

2
0
Sign in
to vote
Type: Bug
ID: 680020
Opened: 7/19/2011 10:15:35 PM
Access Restriction: Public
1
Workaround(s)
1
User(s) can reproduce this bug
When using NetMsmqBinding with a transactional queue and a Service is exposed with more than one Endpoint (two o more svc files with the same service type defined in the markup), a MsmqException (0xC00E0051) is sometimes thrown just 60 seconds after the message is processed.
Details (expand)

Product Version

.NET Framework 4.0

Product Language

English

Operating System

Windows Server 2008 RTM/SP1/SP2

Operating System Language

English

Operating System Language

English

Architecture

x64

Priority
(1=blocking, 2=important, 3=nice to have)

3

Severity
(1=major functionality issue, 2=important functionality issue, 3=nice to have)

2

Steps to Reproduce

MyService1 Queue:
private/Serivces/MyService1.svc

MyService2 Queue:
private/Services/MyService2.svc

MyService1.svc:
<%@ServiceHost language="c#" Debug="true" Service="MyService" %>

MyService2.svc:
<%@ServiceHost language="c#" Debug="true" Service="MyService" %>

Web.config:
<service name="MyService">
<endpoint contract="IMyService1" binding="netMsmqBinding" address="net.msmq://localhost/private/Serivces/MyService1.svc">
</endpoint>
<endpoint contract="IMyService2" binding="netMsmqBinding" address="net.msmq://localhost/private/Services/MyService2.svc">
</endpoint>
</service>

Code:
public class MyService1 : IMyService1, IMyService2 {...}

Actual Results

When a new message arrives, two ServiceHosts are created listening to the same queue, the first one receives the message and the second one throws a MsmqException (Com+ timeout 0xC00E0051) after 60 seconds.

In order to see the error you need either to enable the WCF trace or to use an IErrorHandler (you need to wait 60 seconds after the ServiceHost is created).

Exception:

System.ServiceModel.MsmqException (0xC00E0051): An error occurred while receiving a message from the queue: Unrecognized error -1072824239 (0xc00e0051). Ensure that MSMQ is installed and running. Make sure the queue is available to receive from. at System.ServiceModel.Channels.MsmqInputChannelBase.TryReceive(TimeSpan timeout, Message& message) at System.ServiceModel.Dispatcher.InputChannelBinder.TryReceive(TimeSpan timeout, RequestContext& requestContext) at System.ServiceModel.Dispatcher.ErrorHandlingReceiver.TryReceive(TimeSpan timeout, RequestContext& requestContext)

Expected Results

It should create just one ServiceHost.

For more information: http://blog.jorgef.net/2011/07/msmqexception.html

Component Usage
(any information on your scenario that may help in investigating your issue)

I tried installing the folowing fix but it didn't solve the problem:
http://support.microsoft.com/kb/2504602

Feel free to contact me if you need more information.

How often does this happen?

Sometimes Happens

Have you seen this problem in other versions?

I don't know if this issue existed previously
File Attachments
File Name Submitted By Submitted On File Size  
wcf-trace.png 7/19/2011 161 KB
Sign in to post a comment.
Posted by Microsoft on 9/14/2011 at 4:37 PM
Thanks for your feedback! I have opened tracking bug in our internal database and we will get back to you if we need any more details.
- Piyush Joshi
[PM, WCF team]
Posted by Microsoft on 7/19/2011 at 11:13 PM
Thank you for your feedback, we are currently reviewing the issue you have submitted. If this issue is urgent, please contact support directly(http://support.microsoft.com)
Sign in to post a workaround.
Posted by Jorge Fioranelli on 7/19/2011 at 10:17 PM
One solution is to create separate services with only one endpoint each of them.

More info: http://blog.jorgef.net/2011/07/msmqexception.html

Regards,

Jorge