How do I programmatically add a substitution filter for IIS?
1 answer
All you need to do is add a wild card in the metabase property ScriptMap
site:
For example:
using (DirectoryEntry de = new DirectoryEntry("IIS://Localhost/W3SVC/2/ROOT"))
{
de.Properties["ScriptMaps"].Add(
@"*,c:\windows\microsoft.net\framework\v2.0.50727\aspnet_isapi.dll,0,GET,HEAD,POST");
de.CommitChanges();
}
The above example renders an ASP.NET 2.0 ISAPI filter as a wildcard filter.
+4
source to share