My application is a dotnet 4 hybrid - MVC in some areas, web forms in others. This application was recently upgraded to dotnet 4 and includes a lot of older code and some mismatched parts. Unfortunately it includes a telerik component that requires me to run the Application pool in classic mode.

In order to fix this (in IIS7) I have to add a handler mapping to the IIS configuration. This mapping is basically a wildcard mapping that points the wildcard path "*" to the %windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll.

The problem I am running into is this: For some reason this mapping gets dropped when deploying the site. So, can I add the functionality of this mapping to the web config? If so, How?

Or is there another solution to make this manually added mapping "sticky" so that it remains in place during and after a deployment? (I am also asking this on StackOverflow, as I'm not sure if this should be a coding question or a Server question)

  • Sure about that in IIS7? I know that from IIS6, but IIS7 sees all requests and routes them. Web.config controls it. – TomTom May 12 '10 at 16:29
  • This is what I'm facing because I'm not sure how to tell the web.config to do the job. Is it an entry to HttpHandlers? If so, what should it consist of? – ferrousoxide May 12 '10 at 16:51

This doesn't help your deployment issue (I'll have to look into that part) but you can always directly edit the web.config server side after it's been deployed. Assuming you have write permissions on the server, obviously.

  • I can edit the web.config, but what change would be made? – ferrousoxide May 12 '10 at 16:27
  • @user42942: can you not find it from the pre-deployment web.config? – squillman May 12 '10 at 17:45
  • I said I'm setting it manually in the IIS7 Console. The problem is I have to set it EVERY time I deploy by hand. I want to find a way to include it in the web.config so I can automate the deployment. Trouble is, I can't figure out how to add the aspnet_isapi.dll to the web.config because HttpHeader entries are looking for a namespace and not a dll, as far as I can tell. – ferrousoxide May 12 '10 at 19:24
  • thanks squillman, it wouldn't have occured to me to check the post-deployment web.config if you hadn't mentioned looking at the pre-deployment one. – ferrousoxide May 13 '10 at 17:14

Alright I figured out what was happening; When you edit the Handler mappings and add a custom one for a single site, it actually edits the web config by adding a 'handlers' element to the system.webServer Section (if it doesn't already exist), and within that it adds the wildcard listing which in my case is this:

        <add name="Wildcard" path="*" verb="*" modules="IsapiModule" scriptProcessor="C:\Windows\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll" resourceType="Unspecified" requireAccess="None" preCondition="classicMode,runtimeVersionv4.0,bitness64" />

so I copied these lines and put them in my web.config for the environment i'm deploying to (which is beta in this case -- but I will need to do the same for production) and viola, the setting is now in place upon deployment. What was happening is that these settings were being lost during each deployment because (obviously) the web.config was being overwritten.

Thanks squillman for trying to assist me on this; Even though i figured it out myself!

  • When I actually do my deployment to production, I will of course change the path to the .dll to use the %windir% variable so it can find what it's looking for! – ferrousoxide May 12 '10 at 20:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy