C
Chao Yang_NJ
Guest
Problem:
Environment:
MSDTC & firewall configurations details:
1. MSDTC service has been started and set startup type to automatic
2. Component Service => Computers => My Computer => Distributed Transaction Coordinator => Local DTC properties => Security Tab:
Check Network DTC Accesss, Allow Remote Clients, All Remote Administration, Allow Inbound, Allow Outbound, No Authentication Reuqired, Enable XA Transactions, Enable SNA LU 6.2 Transactions.
DTC Logon Account use Network Service.
3. close firewall
4. firewall allow Distributed Transaction Coordinator app
5. firewall advanced settings inbound and outbound add 135 port and msdtc.exe
6. success to execute subinacl: subinacl /service msdtc /grant="Network Service"=QSETIL
7. Sql server instance properties => connections, checked Require distributed transactions for server-to-server communication
.net console program:
Error Message: MSDTC on server 'L-CHAOYANG' is unavailable.
Code:
using (var tt = new TransactionScope())
{
var a = new AGMEntities();
var b = new AGMAdminEntities(); // 2 dbcontexts are both in local sql server 2014
var users = a.USERs.ToList();
var logins = b.LOGINs.ToList(); // this line throw exception message:MSDTC on server 'L-CHAOYANG' is unavailable.
}
Console.WriteLine();
Sql Server error message:
The Microsoft Distributed Transaction Coordinator (MS DTC) service could not be contacted. If you would like distributed transaction functionality, please start this service.
More...
- MSDTC service has been started. But debuged .net console program and still got one error "MSDTC on server 'XXXXX' is unavailable.". And check sql server log is "The Microsoft Distributed Transaction Coordinator (MS DTC) service could not be contacted. If you would like distributed transaction functionality, please start this service."
- I have already restarted my laptop again and again. And try to others' solutions to fix this problem, but they didn't work.
Environment:
- OS: Windows 10 Pro x64
- SS version: Microsoft SQL Server 2014 (SP1-GDR) (KB4019091) - 12.0.4237.0 (X64) Jul 5 2017 22:03:42 Copyright (c) Microsoft Corporation Developer Edition (64-bit) on Windows NT 6.3 <X64> (Build 18362: )
- Program: .net console program use multiple dbcontexts
- Program and SQL Server 2014 are both installed in local(windows 10 pro)
MSDTC & firewall configurations details:
1. MSDTC service has been started and set startup type to automatic
2. Component Service => Computers => My Computer => Distributed Transaction Coordinator => Local DTC properties => Security Tab:
Check Network DTC Accesss, Allow Remote Clients, All Remote Administration, Allow Inbound, Allow Outbound, No Authentication Reuqired, Enable XA Transactions, Enable SNA LU 6.2 Transactions.
DTC Logon Account use Network Service.
3. close firewall
4. firewall allow Distributed Transaction Coordinator app
5. firewall advanced settings inbound and outbound add 135 port and msdtc.exe
6. success to execute subinacl: subinacl /service msdtc /grant="Network Service"=QSETIL
7. Sql server instance properties => connections, checked Require distributed transactions for server-to-server communication
.net console program:
Error Message: MSDTC on server 'L-CHAOYANG' is unavailable.
Code:
using (var tt = new TransactionScope())
{
var a = new AGMEntities();
var b = new AGMAdminEntities(); // 2 dbcontexts are both in local sql server 2014
var users = a.USERs.ToList();
var logins = b.LOGINs.ToList(); // this line throw exception message:MSDTC on server 'L-CHAOYANG' is unavailable.
}
Console.WriteLine();
Sql Server error message:
The Microsoft Distributed Transaction Coordinator (MS DTC) service could not be contacted. If you would like distributed transaction functionality, please start this service.
More...