简体   繁体   中英

How to get Elmah working with ASP.NET and IIS 5.1 URL Routing

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.

Problem:

I am able to view my elmah error page (localhost/mvcapplication1/elmah.axd), however, the CSS is missing and none of the links work.

Steps to Reproduce

1) Create an ASP.NET MVC 1.0 Application

2) Add Elmah. Download the assemblies, add them to your project and use the steps from Elmah Setup Instructions

3) Switch your application to 'Use Local IIS Web Server' from Property Pages --> Web

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) 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");

Now.. run the app and bring up localhost/mvcapplication1/elmah.axd.

No CSS and links are broken.

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.

Thoughts??

Add FixIIS5xWildcardMapping module to your web.config:

<httpModules>
    <add name="FixIIS5xWildcardMapping" type="Elmah.FixIIS5xWildcardMappingModule, Elmah"/>
</httpModules>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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