views:

34

answers:

2

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 ServerFault, as I'm not sure if this should be a coding question or a Server question)

A: 

If you have no other web sites on the server, you can change the default IIS settings for the "root" web site - these will then be inherited when any new web site is created which is presumably what is happening when you deploy your site.

Daniel Renshaw
A: 

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:

<system.webServer>
    <handlers>
        <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" />
    </handlers>
</system.webServer>

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.

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