简体   繁体   English

调试VS 2008和IIS中的现有ASP.NET应用程序

[英]Debugging an existing ASP.NET application in VS 2008 and IIS

I'm an asp.net newbie. 我是一个asp.net新手。 I have inherited a base of asp.net mvc code and in order to help myself orient better in the heaping pile of source in front of me I'd like to step through it in a debugger. 我继承了asp.net mvc代码的基础,为了帮助自己更好地在我面前堆积源代码中,我想在调试器中逐步完成它。 However, being the microsoft platform newbie I am, I don't know how to go about this. 但是,作为我的微软平台新手,我不知道该怎么做。

Our application serves content under many different hostnames, which I have set up in my hosts file, so that I can access the app under uris like customername.mysite.loc. 我们的应用程序提供了许多不同主机名下的内容,我在主机文件中设置了这些主机名,以便我可以访问uris之类的应用程序,如customername.mysite.loc。 Because of this I think using the built-in web server in Visual Studio 2008 is not an option in my case and that I should attach my VS debugger directly to the IIS process under which the application happens to be running. 因此,我认为在我的情况下使用Visual Studio 2008中的内置Web服务器不是一个选项,我应该将我的VS调试器直接附加到应用程序正在运行的IIS进程。

Unfortunately I haven't found a whole lot of information on Google on how to do this. 不幸的是,我没有在谷歌上找到关于如何做到这一点的大量信息。 Most of the tutorials found there either contradict each other or use various older versions of IIS (I'm running 7.0 under Windows Server 2008). 发现大多数教程要么互相矛盾,要么使用各种旧版本的IIS(我在Windows Server 2008下运行7.0)。 Apparently the solution involves compiling my sources in debug mode (which I have done), setting the application in IIS into debug mode and attaching to the process somehow, but so far I've had no success with this simple outline. 显然,解决方案涉及在调试模式下编译我的源代码(我已经完成),将IIS中的应用程序设置为调试模式并以某种方式附加到进程,但到目前为止,我对这个简单的大纲没有成功。

Can anyone please point me to a working guide or describe a better way to debug my project? 有谁能请我指向工作指南或描述更好的方法来调试我的项目? Is what I want to do even possible? 我甚至想做什么? Thanks a lot! 非常感谢!

You'll want to make sure the remote debugging service is installed and running on the server. 您需要确保在服务器上安装并运行远程调试服务。 You'll then want to attach to your worker process (or all of them is simplest) using the method Andre Bullock states. 然后,您将使用Andre Bullock所述的方法附加到您的工作流程(或所有这些流程最简单)。

"How to run the remote debugger" “如何运行远程调试器”

Debug -> Attach to process -> w3wp.exe 调试 - >附加到进程 - > w3wp.exe

Make sure you fire up the site first so that w3wp is running, also you may have multiple instances running, get the right one (trial and error usually) 确保首先启动站点以便运行w3wp,也可以运行多个实例,获取正确的实例(通常是试用和错误)

:D :d

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM