2

I am confused about setting the port range for DTC communication. What is the difference (functionally) by setting the ports via dcomcnfg as described in this NServiceBus Article versus configuring them through the registry as described in this Microsoft Support article? Is there any reason one would behave differently or are these completely different settings that just appear similar?

Robin
  • 23
  • 5

1 Answers1

1

There is no difference*, as in both cases the Ports value under HKEY_LOCAL_MACHINE\Software\Microsoft\Rpc\Internet Registry key is being modifying. The screenshot below shows the registry modification (captured using ProcMon), which happens when setting the port range using DCOMCNFG:

DCOMCNFG Registry Port Changes

Anyhow, at some point in time, Microsoft recommended to edit Registry directly instead, due to a bug inside DCOMCNFG, which is documented under KB201911 (notice that the statement below confirms DCOMCNFG is in fact modifying HKLM\SOFTWARE\Microsoft\RPC\Internet\Ports):

When a port range is specified for a protocol, such as 4000-4010, the value that is written to the registry key HKLM\SOFTWARE\Microsoft\RPC\Internet\Ports (named REG_MULTI_SZ) is "4000 - 4010." A space is added preceding and succeeding the "-".

There is another Microsoft KB (KB217351), which refers to this bug, and suggests the following:

If you used the DCOMCNFG utility to configure port restrictions, you may be encountering a known DCOMCNFG bug. Rather than use the DCOMCNFG utility, use Regedt32.exe to configure the port restrictions as described in the white paper.

*Therefore, unless you are using a non-supported version of Windows, which relies on Microsoft COM+ 2.0, the bug mentioned above is no longer applicable, and you are free to either use DCOMCNFG or edit HKLM\SOFTWARE\Microsoft\RPC\Internet\Ports directly