开发者

Remote Debug with Amazon Web Services (EC2) and c# Windows Service/WCF

I have a Windows Server 2008开发者_如何学Python R2 in the Amazon EC2 cloud. I would love to be able to debug my C# Windows Service or WCF Service that is running on that server from my desktop in my office.

In the past we got around it by installing Visual Studio on the server in the cloud, but we use remote debugging for our local servers, so I was hoping there was a way to make it work in the cloud.

Has anyone out there accomplished remote debugging to the Amazon cloud without a VPC/Domain in the cloud?

Any suggestions or solutions would be most appreciated.


There isn't anything different about remote debugging against an EC2 instance than there is about remote debugging against a local server EXCEPT firewall configuration...

I would recommend setting up a VPN connection to the EC2 server instead of opening up firewall ports (PPTP is quick and easy).

If you would rather open firewall ports I "think" you will at least need the following (untested):

TCP 139, TCP 445, UDP 137, UDP 138 (all related to DCOM)


Another thing that always causes issues for me on EC2 instances is not passing the /hostname parameter to msvsmon. msvsmon likes to default to the internal hostname and will startup showing something like "listening on 'ip-1-2-3-4.us-west-2.compute.internal", which means it will ignore attempts for connections from Visual Studio clients that think they are talking to 'ec2-7-8-9-0.us-west-2.compute.amazonaws.com'. To fix this, get the full public DNS name or public IP of your EC2 instance and then launch msvsmon.exe as:

msvsmon.exe /hostname ec2-7-8-9-0.us-west-2.compute.amazonaws.com

Then in Visual Studio:

  1. Tools-->Attach To Process
  2. Set Transport to "Default"
  3. Set the Qualifier to whatever you passed for a hostname when you launched msvsmon.exe
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜