Tech Dreams

How To Fix “MSDTC on server ‘server name’ is unavailable” Error[ASP.NET/SQL Server]

When I used the .NET TransactionScope object to control a transaction in a web page the following error message greeted me

————————————————————————————————————————

MSDTC on server ‘GopinathM’ is unavailable.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException: MSDTC on server ‘GopinathM’ is unavailable.

————————————————————————————————————————

This error occurs when the “Distributed Transaction Coordinator” service is not running. To start a distributed transactions with TransactionScope object, the windows service “Distributed Transaction Coordinator” should be running.

To fix the problem just start the service “Distributed Transaction Coordinator” using Windows Service manager.

Here are the detailed steps for starting the service

  1. Click on Start–>Control Panel->Administrative Tools->Services (or simply type services.msc in the run command box and hit enter); display “Services” manager
  2. Scroll through the list and identify the service “Distributed Transaction Coordinator”
  3. Right on the service and choose “Start”

When SQL Server and the Application Server are on different boxes

The above said solution work well when SQL Server and the Application are on the same box. If they are deployed on different boxes then additionally you should follow these steps to correct the problem

  1. Click Start–>Control Panel –> Adminstrative Tools –> Component Services –> Computers
  2. Right click on My Computer and choose  Properties option
  3. Switch to MS DTC tab and check allow remote access

Repeat these steps on Application Server and Database server

6 Comments on How To Fix “MSDTC on server ‘server name’ is unavailable” Error[ASP.NET/SQL Server]

  1. Cong
    September 24, 2011 at 10:34 am (8 years ago)

    thanks, I was fix it :)

    Reply
  2. marco
    May 31, 2011 at 10:05 am (8 years ago)

    It worked! Thx!

    Reply
  3. Bilal Haider
    July 19, 2009 at 4:38 pm (10 years ago)

    Thanx fro the tip.

    First Half worked,
    2nd half still not working (remote access to the sql server)
    Error Message:
    “The partner transaction manager has disabled its support for remote/network transactions. (Exception from HRESULT: 0x8004D025)”

    Reply
  4. john
    July 18, 2009 at 12:27 am (10 years ago)

    Thanks for your contributions, this saved me alot of time.

    Reply
  5. Sam
    July 7, 2009 at 8:49 am (10 years ago)

    Worked like a charm……….absolutely wonderful.Thanks for the post

    Reply
  6. chris
    February 20, 2009 at 1:01 am (11 years ago)

    First on the list when I searched with Yahoo, and most importantly it worked!

    Thanks for your contributions, this saved me alot of time.

    Reply

Leave a reply to marco

Click here to cancel reply.