It is possible to revert handler mappings for an application to parent manually by following below steps:
Is there a way achieve the same task programmatically (appcmd.exe, VBScript, C#..) ?
Note: If there is a custom setting already defined for the application, aspnet_regiis -i command does not work. The only way I have found so far is to remove application from IIS and add it again by code.
The following works for the question:
using System;
using System.Text;
using System.DirectoryServices;
namespace RevertToParentHandlerMappings
{
class Program
{
static void Main(string[] args)
{
string vDirPath = "IIS://localhost/W3SVC/1/ROOT/AppName";
DirectoryEntry vDir = new DirectoryEntry(vDirPath);
vDir.Properties["ScriptMaps"].Clear();
vDir.CommitChanges();
}
}
}