摘要:由于需要写一个安装程序来配置IIS的*映射(.Text也适用,完成了我会把安装程序发给Scott),却遇到了一些问题,现在通过动力营的朋友帮忙,已经解决了:
问题描述:最初的代码在IIS6.0上通过,而在IIS5.0上不通过
编程配置:(用System.DirectoryServices.DirectoryEntry类)
string path = "IIS://localhost/w3svc/1/root";
DirectoryEntry root = new DirectoryEntry(path);
string configuration = “"*,X:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\aspnet_isapi.dll,4,全部”;
// 英文版请将全部改为All
root.Properties["ScriptMaps"].Add(configuration);
root.CommitChanges();
解决方法:IIS6的ScriptMaps设定以字符串'All'来表示包含所有的http动词,而IIS5里用'缺省(空)'来表示包含全部。
感谢:张文隽 微软全球技术中心 微软动力营合作伙伴技术支持...[
阅读全文]