Click here to Skip to main content
15,885,537 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I have a code that create ScriptMap named AboMapperCustom but the code needs IIS6 compatiability to be enabled. If it is disabled then I am getting a error which says "Cannot create script maps"

So now I am using this code

using (ServerManager serverManager = new ServerManager())
{

ConfigurationSection handlersSection = webConfig.GetSection("system.webServer/handlers");
ConfigurationElementCollection handlersCollection = handlersSection.GetCollection();
ConfigurationElement addElement = handlersCollection.CreateElement("add");
addElement["name"] = @"AboMapperCustom";
addElement["path"] = @"*.css";
addElement["verb"] = @"GET,HEAD,POST";

addElement["scriptProcessor"] = @"%windir%\Framework64\v4.0.30319\aspnet_isapi.dll";
addElement["resourceType"] = @"Either";
handlersCollection.AddAt(0, addElement);

serverManager.CommitChanges();
}

Now with this script map is getting added but in Asp.net app pool. I want in my custom app pool. How to do that?

Secondly with earlier code, it was adding AboMapperCustom-(number) with path as ".css". What is abomappercustom and how this can be added in iis7.


Note: I dont want IIS6 compatiability to be enabled.

Kindly help me in this.
Thanks
Posted
Updated 8-Jul-15 3:27am
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900