MSDTC - 与底层事务管理器的通信失败

M00*_*005 24 c# msdtc

我收到错误:

与底层事务管理器的通信失败

当我试图从visual studio 2010运行我的应用程序.我在谷歌搜索此问题,我已尝试所有可能的解决方案来解决此错误.

在这里,我改变了我的DTC属性.

-- Network DTC Access
-- Allow Inbound
-- Allow Outbound
-- Allow Remote Administrator
-- Allow Remote Clients
-- No Authentication Required
-- Enable XA Transaction
-- Enable SNA LU 6.2 Transaction
Run Code Online (Sandbox Code Playgroud)

如果有人知道这个问题的解决方案,请告诉我.

谢谢Manoj Sitapara

Tuy*_*yen 27

尝试允许DTC通过防火墙进行通信.

在此输入图像描述


Mar*_* N. 15

DTCPing在分布式事务中涉及的所有计算机上下载并运行它.

大多数时候它会给你确切的错误和错误(比如相同的CID)等等.

可能的原因:

  1. NetBIOS名称无法访问计算机.在这种情况下,您必须调整其hosts文件以添加映射IP /主机名,或者,如果在域中,则为它们添加DNS别名.
  2. 服务器是VM,它们是从同一个VM实例克隆的.在这种情况下,MSDTC CID是相同的,您需要安装/重新安装MSDTC(DTCping将告诉您这一点).


Gre*_*ray 5

查看MSDTC 故障排除指南,其中将重复的 CID 列为潜在问题。您可以使用以下 Powershell 脚本来检测重复的 CID,并在需要时使用 WinRM 重新安装 MSDTC:

write-host "Checking for duplicate CIDs and reinstalling MSDTC if needed."
$servers = "server1","server2","server3"
$CIDs = Invoke-Command -ComputerName $servers -ScriptBlock { gci Microsoft.PowerShell.Core\Registry::HKEY_CLASSES_ROOT\CID | foreach { $_.Name } | Out-String -Stream } #Array of all CIDs on all servers
$UniqueCIDs = $CIDs | select -Unique
if($CIDs.Length -eq $UniqueCIDs.Length){
    Write-Output "All CIDs are unique, so we don't need to reinstall MSDTC"
} else {
    Write-Output "Found duplicate CIDs, so we need to reinstall MSDTC on all VMs"
    Invoke-Command -ComputerName $servers -ScriptBlock {
        write-output "`r`nUninstalling MSDTC to regenerate CIDs on $env:computername" 
        msdtc -uninstall | Write-Output
        sleep 25 #wait for previous command to finish
        write-output "`r`nReinstalling MSDTC to regenerate CIDs on $env:computername" 
        msdtc -install  | Write-Output
        sleep 25 #wait for previous command to finish
        write-output "`r`nSetting MSDTC service to automatic on $env:computername" 
        Set-Service msdtc -startuptype "auto"
        write-output "`r`nWARNING: $env:computername may need to be restarted for changes to take effect." 
    }
}
Run Code Online (Sandbox Code Playgroud)