5

我有 2 个 ASP.NET 应用程序、1 个 WebForms 和 1 个 MVC。Combres 在本地从事 IIS Express 工作时,两者都表现出色。将两个应用程序部署到测试服务器(IIS 7,两个应用程序都在 IIS 中的同一个网站中)后,WebForms 应用程序页面中引用的 combres.axd 链接返回 404,而 MVC 应用程序工作正常。

我也将 WebForms 应用程序连接到我的本地 IIS,它再次运行良好。

我查看了本地 IIS、MVC 应用程序和 WebForms 应用程序之间的模块和处理程序,并且路由注册似乎相同。

如果我设置 defaultDebugEnabled="true" 那么它会为资源集中的每个脚本生成一个脚本标记并且工作正常。

任何想法如何从 Combres.axd 调试 404?

4

1 回答 1

3

将其跟踪到 web.config 中的模块配置:

<system.webServer>
    <modules runAllManagedModulesForAllRequests="true"/>
</system.webServer>

我正在使用围绕 .NET 3.0/3.5 创建的旧版 WebForms 应用程序,因此我没有设置 runAllManagedModulesForAllRequests 属性。我在最新的 Visual Studio 2010 ASP.NET WebForms 模板中看到,现在这是默认设置。

我还发现了一篇文章,它建议使用一种不那么蛮力的方法来让 UrlRoutingModule 捕获 combres.axd 路由。

<system.webServer>
    <modules>
        <remove name="UrlRoutingModule-4.0" />
        <add name="UrlRoutingModule-4.0" type="System.Web.Routing.UrlRoutingModule" preCondition="" />
    </modules>
</system.webServer>

其中一条评论提到了此更新,但我尚未对其进行测试:

http://support.microsoft.com/kb/980368

于 2011-10-04T17:56:17.950 回答