设为首页 收藏本站
查看: 400|回复: 0

[经验分享] Remote debugging with Visual Studio 2008

[复制链接]

尚未签到

发表于 2016-5-22 10:20:36 | 显示全部楼层 |阅读模式
I recently examined the JavaScriptdebugger featuresin Visual Studio 2008 that aid in locating problems in Web pages. But if you often have to track down bugs in an application installed on another machine, you should check out Microsoft's remote debugger tool with Visual Studio 2008. Here's a closer look at its set-up and usage.
  Example scenario
  You develop an application and then deploy it to another server when aproblem occurs. The code works on your development system, so finding the bug just became more complicated. You may have access to the application environment, but you rarely want to install a full copy of Visual Studio on a server. This is where the remote debugger enters the picture.
  Getting the remote debugger to work
  To get the remote debugger up and running, you must install it on theremote computer (ie, the server in the previously described scenario) and then configure it. Configuration is complex because the remote debugger authenticates both ways; that is, the machine running Visual Studio needs to authenticate on the remote machine, and the remote machine needs to authenticate on the machine running Visual Studio.
  Installation
  When you install Visual Studio 2008, remote debugging components install by default. In addition, the remote debugger is readily available on the Visual Studio installation media. The installation disccontains a directory called Remote Debugger, which has two folders (x64and x86) that contain the set-up application for the specific platform.This installs the remote debugging monitor (msvsmon.exe). In my example, it is installed on a server.
  Once the installation application runs, the configuration wizard runs. The configuration wizard allows you to set up the remote debugger to run as a service or as an application. Running the remote debugger asa service means that it will run all the time, so you may want to run it as an application so it can be run only when needed. At this point, security becomes an important aspect of set-up.
  Security
  The remote debugger must run using a user account that has the appropriate privileges. It must use an account that has at least the same privileges as the account used to run the application being debugged.
  When working with ASP.NET applications, the ASP.NET worker process (aspnet_wp.exe) usually runs with an account called ASPNET, so you must use this account (or an account with equal or greater privileges) to remotely debug it. A safe bet is running the remote debugger with administrative level access, but this is not advisable for a production environment since the remote debugger needs to communicate with your debugger via the network, thus putting the server at risk of being hacked. I like to create a specific account for the remote debugger witha name like VSDebugger and make sure it has appropriate access.
  Using the remote debugger
  Once you install all the components, you can use the remote debugger with your own applications. Follow these steps to use it with a C#/VB.NET application:
  |> In Visual Studio, choose Properties on the Project menu.
|> Select Debug from the Properties page.
|> For the Start Action setting, select Start External Programand in the field type the complete path to the executable on the host computer (running the remote debugger monitor).
|> Under Start Options in the working directory box, type the directory where the executable is located.
|> Select Use Remote Machine and type the name of the remote computer in the field. You can specify any command line arguments to pass to the application on the remote computer.
|> Start the Remote Debugging Monitor on the remote computer.
|> In Visual Studio, you can begin debugging the application via the usual Debug menu by selecting Start to begin a debugging session.
  When working with an ASP.NET application, be sure to reference the remote computer by name and not the IP address. Also, the application's web.config file must have the debug attribute set to True. The site's security settings must allow windows authentication (or anonymous), and make sure there are no firewall restrictions that may disable remote debugging. MSDN offers more information about setting up remote debugging.
  Go to the source
  Visual Studio 2008's remote debugger feature allows you to investigate code issues where they occur. You may use Visual Studio on your development machine and connect to the problem code on a remote host; this allows you to find problems specific to the host environment.During set-up, it's important to use the proper accounts with necessaryaccess. Add the remote debugger to your developer toolbox for those situations where problems are unique to an application's environment.
  What debugging tools or techniques do you use in your projects? Have you ever used the Visual Studio 2008 remote debugger? Share your thoughts and experiences with the Web Developer community.

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-220230-1-1.html 上篇帖子: 瑞星2008主动防御技术分析 下篇帖子: WTL Wizard for Visual Studio 2008
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表