简体   繁体   English

Asp.Net:在IIS中调试网站

[英]Asp.Net: Debug website in iis

Is it possible to debug an Asp.Net website running on iis? 是否可以调试在iis上运行的Asp.Net网站? I am able to debug an Asp.Net web application project, but not a web site, and wanted to know if this is by design or am I missing something. 我能够调试一个Asp.Net Web应用程序项目,但不能调试一个网站,并且想知道这是设计使然还是我缺少了什么。

Had this same problem. 遇到了同样的问题。 The key is to not open the project using the visual studio project file. 关键是不要使用Visual Studio项目文件打开项目。

  1. In IIS, under your Default Web Site, you need to have already created an application, and pointed it at the folder containing the files. 在IIS的“默认网站”下,您需要已经创建了一个应用程序,并将其指向包含文件的文件夹。
  2. In Visual Studio, go to File > Open > Web Site (Shift+Alt+O). 在Visual Studio中,转到“文件”>“打开”>“网站”(Shift + Alt + O)。
  3. Select the newly-created application. 选择新创建的应用程序。
  4. You'll notice the solution explorer now uses the URL in place of the project name. 您会注意到,解决方案资源管理器现在使用URL代替项目名称。 (http://localhost/mysite/) (http:// localhost / mysite /)
  5. Click the debug arrow like normal. 像通常一样单击调试箭头。

您可以将asp_wp附加到Visual Studio调试器中进行调试。

This should work: 这应该工作:

  1. Compile project in Debug mode. 在调试模式下编译项目。
  2. Set debug="true" in the web.config. 在web.config中设置debug =“ true”。
  3. Attach to IIS working process (which v of IIS do you use?) (Ctrl-Alt-P in VS). 附加到IIS工作进程(您使用IIS的哪个v?)(VS中的Ctrl-Alt-P)。 There can be MANY processes. 可能有许多过程。 MAKE SURE YOU ATTACH TO THE CORRECT ONE . 确保您正确地安装了一个

It works fine for me. 这对我来说可以。 You just copy the files over to the IIS folder, set IIS up and go. 您只需将文件复制到IIS文件夹,设置IIS即可。 (If on the same machine). (如果在同一台计算机上)。 Make sure your project properties specify "Custom web server" and " http://localhost " (or whatever). 确保您的项目属性指定“自定义Web服务器”和“ http:// localhost ”(或其他名称)。

On Vista you need to be running Visual Studio as an Administrator. 在Vista上,您需要以管理员身份运行Visual Studio。

If you're running your IIS on a different machine, you'll need to install the Remote Debugger which is on your Visual Studio disks and connect to hat by using Debug|Attach To Process in Visual Studio. 如果要在其他计算机上运行IIS,则需要安装Visual Studio磁盘上的远程调试器,并使用Visual Studio中的“调试” |“附加到进程”连接到hat。

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

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