Azure with Azure SQL Server: ArgumentException: Va

2019-08-10 02:42发布

问题:

Never seen this on our local servers, but after deploying the MVC4 application and the SQL Server database to Azure we sometimes get the following exception, how to tackle this problem?

[ArgumentException: Value does not fall within the expected range.]
System.Transactions.Oletx.IDtcProxyShimFactory.ConnectToProxy(String nodeName, Guid resourceManagerIdentifier, IntPtr managedIdentifier, Boolean& nodeNameMatches, UInt32& whereaboutsSize, CoTaskMemHandle& whereaboutsBuffer, IResourceManagerShim& resourceManagerShim) +0
System.Transactions.Oletx.DtcTransactionManager.Initialize() +155
System.Transactions.Oletx.DtcTransactionManager.get_ProxyShimFactory() +76
System.Transactions.TransactionInterop.GetOletxTransactionFromTransmitterPropigationToken(Byte[] propagationToken) +160
System.Transactions.TransactionStatePSPEOperation.PSPEPromote(InternalTransaction tx) +78

No clue where to start debugging. Thanks for any help!!

回答1:

System.Transactions.Oletx.IDtcProxyShimFactory

DTC (Distributed Transactions Coordinator) is not supported in Azure. By any means. You have to re-design your code to get rid of distributed transactions and use simple transactions.