问题描述
我有关于运行我的ASP.NET MVC应用程序通过我本地IIS 5.1 Web服务器的问题。我相信这些问题都涉及到IgnoreRoutes,但我似乎无法手艺的IgnoreRoute使得它解决了问题。
I am having issues with regards to running my ASP.NET MVC application thru my local IIS 5.1 web server. I believe these issues are related to IgnoreRoutes, but I can't seem to craft an IgnoreRoute such that it resolves the problem.
问题:
我可以查看我的ELMAH错误页面(本地主机/ mvcapplication1 / elmah.axd),但是,CSS是失踪,没有任何的联系工作。
I am able to view my elmah error page (localhost/mvcapplication1/elmah.axd), however, the CSS is missing and none of the links work.
步骤来重现
1)创建一个ASP.NET MVC 1.0应用程序
1) Create an ASP.NET MVC 1.0 Application
2)添加ELMAH。下载组件,将其添加到您的项目,并使用步骤从 ELMAH安装说明
2) Add Elmah. Download the assemblies, add them to your project and use the steps from Elmah Setup Instructions
3)从属性页切换您的应用程序使用本地IIS Web服务器 - >网站
3) Switch your application to 'Use Local IIS Web Server' from Property Pages --> Web
4)添加通配符映射。也就是说,打开IIS,进入属性 - >虚拟目录 - >配置 - >添加:可执行文件:C:\ WINDOWS \ Microsoft.NET \框架\ V2.0.50727 \ aspnet_isapi.dll的扩展名:*限制为:GET,HEAD,POST,DEBUG取消选中检查文件是否存在
4) Add the wildcard mapping. That is, open up IIS, go to properties --> Virtual directory --> Configuration --> Add: Executable: C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll Extension: .* Limit To: GET, HEAD, POST, DEBUG Uncheck 'Check that file exists'.
5)确认 routes.IgnoreRoute({}资源个.axd / {*} PATHINFO);
存在于你Global.aspx的的RegisterRoutes。顺便说一句,我也尝试过 routes.IgnoreRoute(elmah.axd);
5) Verify that routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
exists in the RegisterRoutes of your Global.aspx. By the way, I have also tried routes.IgnoreRoute("elmah.axd");
现在..运行应用程序,并打开本地主机/ mvcapplication1 / elmah.axd。
Now.. run the app and bring up localhost/mvcapplication1/elmah.axd.
没有CSS和链路断开。
No CSS and links are broken.
如果我删除通配符映射,一切都很好,但随后的应用程序URL路由不再起作用。我明白,但我应该能够拉起来elmah.axd与适当IgnoreRoute方案。
If I remove the wildcard mapping, all is fine, but then the application URL routing no longer works. I understand that, but I should be able to pull up the elmah.axd with the proper IgnoreRoute scheme.
思想??
推荐答案
添加FixIIS5xWildcardMapping模块,你的web.config:
Add FixIIS5xWildcardMapping module to your web.config:
<httpModules>
<add name="FixIIS5xWildcardMapping" type="Elmah.FixIIS5xWildcardMappingModule, Elmah"/>
</httpModules>
这篇关于如何获得ELMAH使用ASP.NET和IIS 5.1 URL路由的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!