使用 Visual Studio 2008 远程调试 Web 应用程序的服务器端

Remote Debugging Server Side of a Web Application with Visual Studio 2008(使用 Visual Studio 2008 远程调试 Web 应用程序的服务器端)
本文介绍了使用 Visual Studio 2008 远程调试 Web 应用程序的服务器端的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以,我了解到在我的测试服务器机器上安装 VS2008 并不是一个好主意,因为它会过多地改变运行时环境.我以前从未尝试过使用 Visual Studio 进行远程调试,那么逐行远程调试服务器端 Web 应用程序代码的最佳"方法是什么.我希望能够设置断点、附加并开始逐行验证代码流以及调试和其他东西:).

So, I've read that it is not a good idea to install VS2008 on my test server machine as it changes the run time environment too much. I've never attempted remote debugging with Visual Studio before, so what is the "best" way to get line by line remote debugging of server side web app code. I'd like to be able to set a breakpoint, attach, and start stepping line by line to verify code flow and, you know, debug and stuff :).

我确信大多数答案都与 ASP.NET 代码有关,我对此很感兴趣,但我当前的代码库实际上是经典 ASP 和 ISAPI 扩展,所以我更关心这一点.

I'm sure most of the answers will pertain to ASP.NET code, and I'm interested in that, but my current code base is actually Classic ASP and ISAPI Extensions, so I care about that a little more.

另外,我的测试服务器在 VMWare 中运行,我注意到在最新的 VMWare 安装中提到了一些关于调试支持的内容,但我不熟悉这意味着什么......任何人都在使用它,它有什么用你呢?

Also, my test server is running in VMWare, I've noticed in the latest VMWare install it mentioning something about debugging support, but I'm unfamiliar with what that means...anyone using it, what does it do for you?

推荐答案

首先,如果服务器和您的工作站在同一个域中(服务器需要访问权限才能连接到您的机器),这会容易得多.在您的 C:Program FilesMicrosoft Visual Studio 9.0Common7IDERemote Debuggerx86(或 x64 或 ia64)目录中是您需要复制到服务器的文件.Visual Studio 版本之间存在不同的版本,因此请确保它们在客户端和服务器端匹配.在服务器上,启动 msvsmon.它会说类似Msvsmon 启动了一个名为 xxx@yyyy 的新服务器".这是您将在 Visual Studio 中用于连接到此服务器的名称.您可以进入工具">选项"来设置服务器名称并设置身份验证模式(希望是 Windows 身份验证)-顺便说一句,无身份验证不适用于托管代码.

First, this is MUCH easier if both the server and your workstation are on the same domain (the server needs access to connect to your machine). In your C:Program FilesMicrosoft Visual Studio 9.0Common7IDERemote Debuggerx86 (or x64, or ia64) directory are the files you need to copy to your server. There are different versions between Visual Studio versions, so make sure they match on the client and server side. On the server, fire up msvsmon. It will say something like "Msvsmon started a new server named xxx@yyyy". This is the name you'll use in Visual Studio to connect to this server. You can go into Tools > Options to set the server name and to set the authentication mode (hopefully Windows Authentication) - BTW No Authentication doesn't work for managed code.

在客户端,打开 Visual Studio 并加载要调试的解决方案.然后转到调试>附加到进程.在限定符"字段中输入您之前看到的服务器名称.单击选择"按钮并选择要调试的代码类型,然后单击确定".希望您会看到可以附加到的服务器上的进程列表(您还应该在服务器上看到调试监视器刚刚说您已连接).找到要附加的进程(如有必要,启动应用程序).如果它是一个 ASP.NET 网站,您将选择 w3wp.exe,然后点击附加.设置断点,希望您现在可以远程调试代码.

On the client side, open up Visual Studio and load the solution you're going to debug. Then go to Debug > Attach to Process. In the "Qualifier" field enter the name of the server as you saw it appear earlier. Click on the Select button and select the type of code you want to debug, then hit OK. Hopefully you'll see a list of the processes on the server that you can attach to (you should also see on the server that the debugging monitor just said you connected). Find the process to attach to (start up the app if necessary). If it's an ASP.NET website, you'd select w3wp.exe, then hit Attach. Set your breakpoints and hopefully you're now remotely debugging the code.

AFAIK - VMWare 选项允许您在 VM 内启动代码,但可以从您的工作站对其进行调试.

AFAIK - the VMWare option lets you start up code inside of a VM but debug it from your workstation.

这篇关于使用 Visual Studio 2008 远程调试 Web 应用程序的服务器端的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

c# Generic Setlt;Tgt; implementation to access objects by type(按类型访问对象的C#泛型集实现)
InvalidOperationException When using Context Injection in ASP.Net Core(在ASP.NET核心中使用上下文注入时发生InvalidOperationException)
Visual Studio 2010 ReportViewer Assembly References(Visual Studio 2010 ReportViewer程序集引用)
how do i pass parameters to aspnet reportviewer(如何将参数传递给aspnet report查看器)
How to Create such a Task Panel?(如何创建这样的任务小组?)
Bind multiple parameters from route and body to a model in ASP.NET Core(在ASP.NET Core中将路由和主体中的多个参数绑定到一个模型)