Combres.axd 在 WebForms 应用程序中返回 404 [英] Combres.axd returns 404 in WebForms app

查看:16
本文介绍了Combres.axd 在 WebForms 应用程序中返回 404的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

我也将 WebForms 应用程序连接到我的本地 IIS,它再次正常工作.

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

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

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

解决方案

将其追溯到 web.config 中的模块配置:

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

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

我还发现了一个 帖子建议使用一种不那么强力的方法来让 UrlRoutingModule 捕捉到 combres.axd 路由.

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

其中一条评论提到了这个更新,不过我还没有测试过:

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

I have 2 ASP.NET apps, 1 WebForms and 1 MVC. Combres worked beautifully for both while working locally on IIS Express. After deploying both apps to the test server (IIS 7, both apps are in the same web site in IIS) the combres.axd link referenced in the pages of the WebForms app is returning a 404, while the MVC app works fine.

I hooked up the the WebForms app to my local IIS as well and it again worked fine.

I looked at the modules and handlers between my local IIS, the MVC app and the WebForms app and the routing registrations appear to be the same.

If I set defaultDebugEnabled="true" then it generates a script tag for each script in the resource set and works fine.

Any ideas how to debug the 404 from combres.axd?

解决方案

Tracked it down to the modules config in web.config:

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

I am working with a legacy WebForms app that was created around .NET 3.0/3.5, so I did not have the runAllManagedModulesForAllRequests attribute set. I see in the latest Visual Studio 2010 ASP.NET WebForms template, this is now the default.

I also found a post that suggests a less brute force method to get the UrlRoutingModule to catch the combres.axd route.

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

One of the comments mentioned this update, I haven't tested it yet though:

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

这篇关于Combres.axd 在 WebForms 应用程序中返回 404的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆