简体   繁体   English

使用IIS调试ASP.NET

[英]Debugging ASP.NET with IIS

I've set up debugging in Visual Studio 2008 to IIS instead of the built in server so I can run url rewriting while developing (using IIRF). 我已经将Visual Studio 2008中的调试设置为IIS而不是内置服务器,因此我可以在开发时运行url重写(使用IIRF)。

It took a while to get to work (changing permissions, reinstalling the .NET framework) but it was working. 它需要一段时间才能开始工作(更改权限,重新安装.NET框架),但它确实有效。

I turned off my machine, and now that it's back on the debugger won't start. 我关闭了我的机器,现在它又回到了调试器上,无法启动。 I'm using Parallels with WinXP on an iMac. 我在iMac上使用Parallels和WinXP。

"Unable to start debugging on the web server. Could not start ASP.NET debugging. More information may be available by starting the project without debugging" “无法在Web服务器上启动调试。无法启动ASP.NET调试。通过启动项目而无需调试,可以获得更多信息”

I read a whole bunch of posts on SO as well as googled the subject but none seem to provide a working answer. 我在SO上阅读了大量的帖子以及Google搜索主题但似乎没有提供可行的答案。

Has anyone encountered this and knows how to get it to work? 有没有人遇到这个并知道如何让它工作?

Thanks. 谢谢。

Make sure you've enabled Windows authentication for your site in IIS. 确保您已在IIS中为您的站点启用了Windows身份验证。

In the IIS MMC snap-in, right-click on your web site, choose "Properties", select the "Document Security" tab, click on "Edit..." in the "Anonymous access and authentication control" box, and make sure that "Integrated Windows authentication" is selected. 在IIS MMC管理单元中,右键单击您的网站,选择“属性”,选择“文档安全性”选项卡,单击“匿名访问和身份验证控制”框中的“编辑...”,然后进行确保选择“集成Windows身份验证”。

尝试手动将VS调试程序附加到w3svc.exe进程。

So after a whole lot of experimenting I managed to find the issue, well kind of. 经过大量的实验,我设法找到了问题,好吧。

The main issue was that Keep-Alives were not enabled, which in turn didn't allow the authentication to work properly. 主要问题是未启用Keep-Alives,这反过来又不允许身份验证正常工作。 With that enabled the debugger actually works. 启用它后,调试器实际上可以工作。 But. 但。 It will only work if I start debugging with a .aspx page selected. 它只有在我选择了.aspx页面开始调试时才有效。 If I start debugging with a .cs page selected it wont. 如果我选择.cs页面开始调试它不会。

Strange, but at least it works! 很奇怪,但至少它有效!

Make sure your IIS website is not bound to any IP address. 确保您的IIS网站未绑定到任何IP地址。 VS 2008 has a problem attaching to bound IPs. VS 2008附加到绑定IP有问题。

我有这个问题,这是因为我在IIS 7中的应用程序池是“经典”而不是“集成”,使用.net 4框架。

Some times if debug element of compilation element on the web.config is set to false, that is the error you get. 有时,如果web.config上的编译元素的debug元素设置为false,那就是你得到的错误。

Also if you are not a member of the Administrators group you tend to get his error. 此外,如果您不是Administrators组的成员,则往往会收到错误消息。

Have you tried to debug with the built-in web server> 您是否尝试使用内置Web服务器进行调试>

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

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