Remote Debugging in Visual Studio (VS2008), Windows Forms Application

前端 未结 6 964
半阙折子戏
半阙折子戏 2021-01-30 17:35

I\'m trying to Remote Debugging a Windows Forms Application (C#), but i\'m always getting this error:

Unable to connect to the Microsoft Visual Studi

6条回答
  •  清歌不尽
    2021-01-30 18:07

    So you're a developer and one of your users got an exception, and you want to debug it remotely without closing the exception window, but they're logged on as a different user account. As it turns out, you can debug their application, but it gets tricky.

    0) You still need matching local accounts on both the remote app machine and the local Visual Studio machine, which means adding an account to the user's computer.

    1) You need to use runas with the /netonly option. Open a command prompt to the folder where msvsmon is and type

    runas /user:[user] /netonly msvsmon
    

    This causes msvsmon to use the user's credentials only when accessing the network (e.g. when msvsmon connects back to the local VS machine). msvsmon will get upset if you call it with runas without using /netonly.

    2) You need to add permissions for the local Visual Studio machine to connect the remote application machine, via the Remote Debug Monitor's Tools->Permissions menu.

提交回复
热议问题