`

Remote debugging with Visual Studio 2008

阅读更多

I recently examined the JavaScript debugger features in 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 a problem 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 the remote 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 disc contains a directory called Remote Debugger, which has two folders (x64 and 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 as a 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 with a 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 Program and 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 necessary access. 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.

分享到:
评论

相关推荐

    Visual Studio 2005 Remote Debugging.mht

    Visual Studio 2005 Remote Debugging.mht

    Visual Studio Remote Debug

    Visual Studio Remote Debugging 是一种强大的工具,允许开发者在一台计算机(本地机)上使用Visual Studio进行代码编写,而实际的程序执行和调试则在另一台计算机(远程机)上进行。这种方式尤其适用于处理大型项目...

    visual studio 调试指南

    visual studio 调试指南 Feature Tour of the Debugger Get Started with the Debugger Navigate Code with the Debugger Watch a Video on using the Debugger Learn about Remote Debugging 。。。

    Node.js Tools for Visual Studio(NTVS)

    NTVS supports the following: ... remote with support for Linux and MacOS Profiling node REPL with multi line editing Integrated npm GUI Azure Web Sites Azure Cloud Service Git publishing

    浅析Visual Studio Code断点调试Vue

    可以通过在Windows右键点击Chrome的快捷方式图标,选择属性,在目标一栏最后加上--remote-debugging-port=9222,注意要用空格隔开。在macOS和Linux平台下,可以通过控制台执行相应的命令来启动Chrome。 二、安装...

    VC_Linux.zip

    在跨平台开发的领域中,Visual Studio提供了如Visual Studio Remote Debugging Monitor这样的工具,它允许开发者在本地机器上编写和调试代码,而实际的执行环境则位于远程的Linux服务器上。这一特性极大地扩展了...

    ASP.NET MVC with Entity Framework and CSS [2016]

    • How to use Visual Studio Scaffolding views and controllers • Manage CRUD operations including model binding as recommended by Microsoft and dealing with cascading deletions correctly • Input and ...

    VS2008远程调试环境搭建[参照].pdf

    在目标机上启动Visual Studio Remote Debugging Monitor,并运行待调试的程序。在调试机的VS2008中,点击“Debug”菜单 -> “Attach to Process…”(如果在Debug菜单中没有找到,可以尝试在“Tools”菜单中查找)...

    NVIDIA_Nsight_Tegra_Release_3.6.19217.7511.exe

    NVIDIA® Nsight™ Tegra®, Visual Studio Edition brings Microsoft Visual Studio to Android, allowing for seamless GDB and JDB remote debugging to all Android devices capable of native application ...

    VS2008 远程调试环境搭建

    - 查找“VisualStudio2008RemoteDebugger”服务。 - 在“登录”选项卡中,选择“此帐户”,并通过“浏览”按钮选择之前创建的用户。 - 输入该用户的密码后保存设置。 - 在“常规”选项卡中点击“启动”按钮,以启动...

    【ASP.NET编程知识】在ASP.NET 2.0中操作数据之七十二:调试存储过程.docx

    此外,还需要正确配置Visual Studio和SQL Server以允许远程调试,具体步骤可以在文章末尾的"Debugging T-SQL Database Objects on Remote Instances"部分找到。 在调试存储过程时,开发者可以查看变量值,跟踪代码...

    professional_windows_embedded_compact_7.pdf

    Explains how to develop native code applications with Visual Studio 2010, develop database applications with SQL server compact, and use the application deployment option Discusses how to deploy a ...

    反编译Unity-debugging-4.x.zip

    在Unity中进行调试,Unity Editor内置了强大的Visual Studio集成,提供了丰富的调试工具,如断点、变量监视、调用堆栈查看等。此外,Unity还支持Unity Profiler,用于性能分析,帮助开发者定位内存泄漏、CPU瓶颈等...

    .net远程调试工具可看日志

    3. **远程调试代理(Remote Debugging Agent)**:这是安装在调试目标机器上的一小部分软件,它负责与调试器通信,使远程调试成为可能。 4. **日志(Log)**:日志文件记录了应用程序运行时的详细信息,包括错误、...

    vc远程系统

    - 安装并启动Remote Debugging Monitor,通常可以在“C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\Remote Debugger”路径下找到。 - 确保防火墙设置允许msvsmon.exe的入站连接,...

    调试工具合集

    msvsmon,全称Microsoft Visual Studio Remote Debugging Monitor,是微软Visual Studio的一部分。这个工具使得开发者可以在远程机器上进行调试,无需在目标计算机上安装完整的Visual Studio。这对于多设备环境下的...

Global site tag (gtag.js) - Google Analytics