简体   繁体   English

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

[英]Remote Debugging Server Side of a Web Application with Visual Studio 2008

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. 所以,我已经读过,在我的测试服务器机器上安装VS2008并不是一个好主意,因为它会过多地改变运行时环境。 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. 我之前从未尝试使用Visual Studio进行远程调试,因此获得服务器端Web应用程序代码的逐行远程调试的“最佳”方法是什么。 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 :). 我希望能够设置一个断点,附加,并逐行开始逐步验证代码流,你知道,调试和东西:)。

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. 我确信大多数答案都与ASP.NET代码有关,我对此感兴趣,但我目前的代码库实际上是经典ASP和ISAPI扩展,所以我更关心它。

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? 此外,我的测试服务器在VMWare中运行,我注意到在最新的VMWare安装中它提到了有关调试支持的内容,但我不熟悉这意味着......任何使用它的人,它对你有什么作用?

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 Files\\Microsoft Visual Studio 9.0\\Common7\\IDE\\Remote Debugger\\x86 (or x64, or ia64) directory are the files you need to copy to your server. 在C:\\ Program Files \\ Microsoft Visual Studio 9.0 \\ Common7 \\ IDE \\ Remote Debugger \\ x86(或x64或ia64)目录中是您需要复制到服务器的文件。 There are different versions between Visual Studio versions, so make sure they match on the client and server side. Visual Studio版本之间有不同的版本,因此请确保它们在客户端和服务器端匹配。 On the server, fire up msvsmon. 在服务器上,启动msvsmon。 It will say something like "Msvsmon started a new server named xxx@yyyy". 它会说“Msvsmon启动了一个名为xxx @ yyyy的新服务器”。 This is the name you'll use in Visual Studio to connect to this server. 这是您将在Visual Studio中用于连接此服务器的名称。 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. 您可以进入工具>选项以设置服务器名称并设置身份验证模式(希望Windows身份验证) - BTW无身份验证不适用于托管代码。

On the client side, open up Visual Studio and load the solution you're going to debug. 在客户端,打开Visual Studio并加载您要调试的解决方案。 Then go to Debug > Attach to Process. 然后转到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. 如果是ASP.NET网站,则选择w3wp.exe,然后点击Attach。 Set your breakpoints and hopefully you're now remotely debugging the code. 设置你的断点,希望你现在可以远程调试代码。

AFAIK - the VMWare option lets you start up code inside of a VM but debug it from your workstation. AFAIK - VMWare选项允许您在VM内部启动代码,但可以从工作站进行调试。

Visual Studio comes with a remote debugger that you can run as an exe on your server. Visual Studio附带一个远程调试器 ,您可以在服务器上以exe身份运行。 It works best if you can run it as the same domain user as your copy of visual studio. 如果您可以将其作为与Visual Studio副本相同的域用户运行,则效果最佳。 You can then do an attach to process from the debugger on your machine to the IIS process on the server and debug as if it was running on your machine. 然后,您可以执行连接以从计算机上的调试器处理到服务器上的IIS进程,并进行调试,就好像它在您的计算机上运行一样。 You get more options for .Net debugging, but there's support for older platforms too. 您可以获得.Net调试的更多选项,但也支持旧版平台。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 无法在Web服务器上开始调试。 Visual Studio 2008年 - Unable to start debugging on the Web Server. Visual Studio 2008 无法在 Web 服务器上开始调试。 Visual Studio 2019 远程调试器 (MSVSMON.EXE) 未出现 - Unable to start debugging on the web server. The Visual Studio 2019 Remote Debugger (MSVSMON.EXE) does not appear 使用Visual Studio 2008调试Sitecore 6 - Debugging Sitecore 6 with Visual Studio 2008 无法在 Web 服务器上开始调试。 远程服务器返回错误:(404) 未找到。 在 Visual Studio 中启动调试时出错 - Unable to start debugging on the web server. The remote server returned an error: (404) Not Found. Error when starting debug in Visual Studio 在Visual Studio 2010上连接到远程SQL Server 2008 - Connect to remote SQL Server 2008 on Visual Studio 2010 Visual Studio中的远程调试问题 - remote debugging problem in Visual Studio 在Visual Studio 2008中的Web应用程序项目中创建程序集 - Create an assembly in a Web Application project in Visual Studio 2008 设计视图冻结在Visual Studio 2008 Web应用程序中 - design view freezes in visual studio 2008 web application 将Visual Studio 2008 Web应用程序部署到IIS 6的正确过程是什么? - What is the correct procedure to deploy a Visual studio 2008 Web Application to IIS 6 使用特定的屏幕分辨率从Visual Studio调试Web应用程序 - Debugging web application from Visual Studio using a specific screen resolution
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM