I have a .net 2.0 WinForms application that uses .net remoting to connect to a server in our DMZ. That side of it is running fine, but I want to debug the services I’ve installed on that machine. I can get everything set up fine, but as soon as I have to restart Visual Studio 2008, the port used to connect back to my machine changes, and I have to call my network admin to change the port on the firewall appliance. They will not open a huge range of ports, because that machine has a VPN connection with another company and they don’t want to open any more routes into our network than they have to.
How can I restrict the port the .net debugger uses on my machine to connect back to it from the remote machine? I’ve tried messing around with a couple of things in Component Services, but it didn’t seem to make a difference.
It appears I have finally found a solution. A post here pointed me in the right direction, following these instructions. I had tried something very similar to this before, but I’d only tried restricting the range on one computer or the other – not both at the same time. I’ve restarted Visual Studio about a half-dozen times now, and it has always chosen a port for DCOM in the range I’ve restricted it to.