这个问题让我发疯:我正在开发一个最近创建的项目,突然我无法调试该特定项目。
我使用带有 IIS UrlRewrite 2 模块的本地 IIS 7.5。我的开发机器是 Windows 7 x64,带有 Visual Studio 2010 Professional。
在其他项目中调试仍然有效。我已在本地 IIS 中设置了一个条目,并开始在本地 IIS 上调试 ASP.net 4.0 项目。
我能够使用 URL Rewrite 2 模块将调试问题跟踪到意外行为,并使用新创建的4.0 Web应用程序项目:
添加一个简单的后URL重写规则使用 IIS 中的管理设计器,我无法开始调试,因为我收到错误消息
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.
(我还尝试从其他项目复制 URL 重写设置,但到目前为止没有成功)
无需调试即可启动项目,效果非常好,并且没有显示任何错误!
除此之外,我只在default.aspx的默认文本中添加了一些字符
IIS 中的站点设置:
- 我创建了一个新站点,分配了一个绑定(哪个端口并不重要,例如我尝试了端口 86),就像我一直做的那样。
- 我将新创建的应用程序池中的用户身份设置为“networkservice”
- 将新创建的应用程序池的框架版本设置为“4.0”
- 我已向用户“networkservice”授予解决方案目录的完整目录权限
我还尝试了其他几种设置组合,例如启用 WindowsAuthentification、FormsAuthentication 等。到目前为止还没有运气。
This is 项目的 Web 选项卡:
服务器:使用本地 IIS Web 服务器,项目 URL“http://localhost:86/”(我也尝试过使用“http://localhost:86”,似乎没有什么区别)
这里发生了什么?我在这里失去了理智。有想法该怎么解决这个吗? (不使用 UrlRewrite 2.0 模块是没有选择的)
最后是网络配置:
<?xml version="1.0" encoding="UTF-8"?>
<!--
For more information on how to configure your ASP.NET application, please visit
http://go.microsoft.com/fwlink/?LinkId=169433
-->
<configuration>
<connectionStrings>
<add name="ApplicationServices" connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\aspnetdb.mdf;User Instance=true" providerName="System.Data.SqlClient" />
</connectionStrings>
<system.web>
<compilation debug="true" targetFramework="4.0" />
<authentication mode="Forms">
<forms loginUrl="~/Account/Login.aspx" timeout="2880" />
</authentication>
<membership>
<providers>
<clear />
<add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="ApplicationServices" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="false" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10" applicationName="/" />
</providers>
</membership>
<profile>
<providers>
<clear />
<add name="AspNetSqlProfileProvider" type="System.Web.Profile.SqlProfileProvider" connectionStringName="ApplicationServices" applicationName="/" />
</providers>
</profile>
<roleManager enabled="false">
<providers>
<clear />
<add name="AspNetSqlRoleProvider" type="System.Web.Security.SqlRoleProvider" connectionStringName="ApplicationServices" applicationName="/" />
<add name="AspNetWindowsTokenRoleProvider" type="System.Web.Security.WindowsTokenRoleProvider" applicationName="/" />
</providers>
</roleManager>
</system.web>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true" />
<rewrite>
<rules>
<rule name="LowerCaseRule1" stopProcessing="true">
<match url="[A-Z]" ignoreCase="false" />
<action type="Redirect" url="{ToLower:{URL}}" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
Update:
显然我可以使用 ActionType="Rewrite" 进行调试,但不能使用 ActionType="Redirect" 进行调试。但仍然没有真正的选择,因为我希望首先解决这个问题,而不是用一些解决方法来解决问题。我现在很想悬赏,但系统不允许。
有人可以重现我的步骤吗? (到目前为止我在两台不同的计算机上得到了这个)