Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6168361
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T22:40:26+00:00 2026-05-23T22:40:26+00:00

I am using the netMsmqBinding with a transactional queue, and although the WCF service

  • 0

I am using the netMsmqBinding with a transactional queue, and although the WCF service is called without problems, the service is throwing a MsmqException just 60 seconds after the message is processed.

This is the 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)

I have done some research, debugging and tracing and I have found that when a new message is received, two transactions are opened, the first one is committed just after the service execution, but the second one is never committed, so then, after 60 seconds, the DTC aborts it throwing the MsmqException.
This is the operation definition:

[OperationBehavior(TransactionScopeRequired = true, TransactionAutoComplete = true)]
public void SomeOperation(SomeParameter parameter)
{
  // business logic
}

Any ideas about what is happening, and how can I solve this issue?

UPDATE:

Config:

<netMsmqBinding>
  <binding name="TransactionalMsmqBinding" exactlyOnce="true" deadLetterQueue="System" receiveErrorHandling="Move">
    <security mode="None"/>
  </binding>
</netMsmqBinding>
...
<service name="SomeNamespace.SomeService">
  <endpoint contract="SomeNamespace.ISomeService" bindingConfiguration="TransactionalMsmqBinding" binding="netMsmqBinding" address="net.msmq://localhost/private/services/someservice.svc">
  </endpoint>
  <endpoint contract="SomeNamespace.IAnotherService" bindingConfiguration="TransactionalMsmqBinding" binding="netMsmqBinding" address="net.msmq://localhost/private/services/anotherservice.svc">
  </endpoint>
</service>

Service Implementation:

[ExceptionShieldingBehavior(typeof(ArgumentValidationException), typeof(ValidationServiceException))]
[AuthorizationAndAuditBehaviour]
[ServiceBehavior(Namespace = GlobalConstants.ServiceContractNamespace)]
public class SomeService: ISomeService, IAnotherService
{
  [OperationBehavior(TransactionScopeRequired = true, TransactionAutoComplete = true)]
  public void SomeOperation(SomeParameter parameter)
  {
    // business logic
  }

  [OperationBehavior(TransactionScopeRequired = true, TransactionAutoComplete = true)]
  public void AnotherOperation(AnotherParameter parameter)
  {
    // business logic
  }
}

Service Contracts:

[ServiceContract(Namespace = GlobalConstants.ServiceContractNamespace)]
public interface ISomeService
{
  [OperationContract(IsOneWay = true)]
  void SomeOperation(SomeParameter parameter);
}

[ServiceContract(Namespace = GlobalConstants.ServiceContractNamespace)]
public interface IAnotherService
{
  [OperationContract(IsOneWay = true)]
  void AnotherOperation(AnotherParameter parameter);
}

Complete behavior:

  1. The client sends a message
  2. The service is activated
  3. The DTC starts two transactions (I can see them in the DTC monitor and in the TransactionManager.DistributedTransactionStarted event)
  4. The first transaction finishes as soon as the operation finishes
  5. The second transaction is aborted 60 seconds after (MsmqException is thrown)
  6. The wcf host (IIS) is sometimes faulted (I have some code to automatically recover it, apparently this behaviour has changed in .net 4)
    • If the host was broken and automatically recovered, all will happen again on next message
    • If the host was not broken, the second transaction won’t start the next time and everything will work without problems :).
    • If I recycle the AppPool, the problem starts again
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T22:40:27+00:00Added an answer on May 23, 2026 at 10:40 pm

    I have found the problem.

    As I am exposing the same Service using two different msmq Endpoints, for some weird reason the SMSvcHost.exe process activates the same Endpoint twice.

    I have just written a post with the solution: http://blog.jorgef.net/2011/07/msmqexception.html

    I hope it helps.

    Jorge

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a WCF service using netMsmqBinding and a client consuming it. I send
I have a MSMQ application using WCF's netmsmqbinding. In the default configuration, and with
Is it possible to guarantee ordered delivery when using WCF netMSMQbinding? We are putting
I have created a WCF Publish/Subscribe service using WSDualHTTPBinding. It allows a server application
Using C# .NET 3.5 and WCF, I'm trying to write out some of the
Using C#, I need a class called User that has a username, password, active
I can work with many WCF bindings, except netMsmqBinding . All I get is:
Using android 2.3.3, I have a background Service which has a socket connection. There's
I have to get the maximum throughput performance in my WCF service. In one
I would like to set the MSMQ message label using the NetMsmqBinding. I understand

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.