title: MSDTC issue with transactions in ADO.NET Entity Framework
body: <p>in our current project we are using ADO.NET Entity Framework as data layer for the application. There are some tasks which require to run in a transaction because there's a lot of work to do in the database. I am using a <a href="http://msdn.microsoft.com/en-us/library/system.transactions.transactionscope.aspx" rel="nofollow noreferrer">TransactionScope</a> to surround those tasks.</p>
  
  <pre><code>using (TransactionScope transactionScope = new TransactionScope(TransactionScopeOption.RequiresNew))
  {
      // Do something...
      transactionScope.Complete();
  }
  </code></pre>
  
  <p>The problem is as soon as i am using an <a href="http://msdn.microsoft.com/en-us/library/system.transactions.transactionscope.aspx" rel="nofollow noreferrer">TransactionScope</a> an exception occurs:</p>
  
  <blockquote>
    <p>System.Data.EntityException: The underlying provider failed on Open. ---> System.Transactions.TransactionManagerCommunicationException: Communication with the underlying transaction manager has failed. ---> System.Runtime.InteropServices.COMException (0x80004005): Error HRESULT E_FAIL has been returned from a call to a COM component.</p>
  </blockquote>
  
  <p>It seems that this error has to do something with the <a href="http://social.msdn.microsoft.com/Search/en-US?query=MSDTC" rel="nofollow noreferrer">MSDTC</a> (Microsoft Distributed Transaction Coordinator). When I change the security configuration of MSDTC another exception is thrown:</p>
  
  <blockquote>
    <p>System.Data.EntityException: The underlying provider failed on Open. ---> System.Transactions.TransactionManagerCommunicationException: Network access for Distributed Transaction Manager (MSDTC) has been disabled. Please enable DTC for network access in the security configuration for MSDTC using the Component Services Administrative tool.</p>
  </blockquote>
  
  <p>However MSDTC is configured, the <a href="http://msdn.microsoft.com/en-us/library/system.transactions.transactionscope.aspx" rel="nofollow noreferrer">TransactionScope</a> will cause an error.
  Does somebody know whats going wrong here?</p>