发文章
发文工具
撰写
网文摘手
文档
视频
思维导图
随笔
相册
原创同步助手
其他工具
图片转文字
文件清理
AI助手
留言交流
一、错误情况
环境:win7+iis7.0
DirectoryEntry配置IIS7出现如下错误
或者是
下面一段代码在IIS6.0下运转正常,但IIS7.0下运转会出错:
System.DirectoryServices.DirectoryEntry iisServer;iisServer = new System.DirectoryServices.DirectoryEntry("IIS://localhost/W3SVC/1");System.DirectoryServices.DirectoryEntry rootFolder = iisServer.Children.Find("Root","IIsWebVirtualDir");//此处抛出异常
异常内容如下:
[System.Runtime.InteropServices.COMException] {"Unknown error (0x80005000)"} System.Runtime.InteropServices.COMException
Unknown error (0x80005000) at System.DirectoryServices.DirectoryEntry.Bind(Boolean throwIfFail) at System.DirectoryServices.DirectoryEntry.Bind() at System.DirectoryServices.DirectoryEntry.get_IsContainer() at System.DirectoryServices.DirectoryEntries.CheckIsContainer() at System.DirectoryServices.DirectoryEntries.Find(String name, String schemaClassName)
二、错误分析
这段异常代码表明 IIS://localhost/W3SVC/1 的ADSI provider不存在或者无法访问。
打开IIS管理器你可以看到服务器的localhost(即默认站点)是存在的并正在运行,且主站点ID确实是1。这说明问题是出现在 IIS://localhost的ADSI provider。
三、错误原因
win7使用的是iis7,而IIS 7默认并没有安装ADSI provider。
四、解决方法
要解决这个问题就得安装“IIS 元数据库和IIS 6配置兼容性”。
“控制面板”->“程序和功能”->面板左侧“打开或关闭windows功能”->“Internet信息服务”->“Web管理工具”->“IIS 6管理兼容性”->“IIS 元数据库和IIS 6配置兼容性”。
如下图所示:
五、更好的解决方法
更理想的解决方式是用 WMI provider操作IIS 7 ,可参见此篇文章http://msdn.microsoft.com/en-us/library/aa347459.aspx
六、Windows Server 2008出现这种错误怎么办?
在Windows Server 2008下,使用角色服务安装完“IIS 元数据库和IIS 6配置兼容性”,还有可能出现如下错误:
[System.Runtime.InteropServices.COMException] {"Access is denied.\r\n"} System.Runtime.InteropServices.COMExceptionErrorCode 0x80070005
Access is denied.
at System.DirectoryServices.DirectoryEntry.Bind(Boolean throwIfFail) at System.DirectoryServices.DirectoryEntry.Bind() at System.DirectoryServices.DirectoryEntry.get_IsContainer() at System.DirectoryServices.DirectoryEntries.CheckIsContainer() at System.DirectoryServices.DirectoryEntries.Find(String name, String schemaClassName)
这是因为 Windows Server 2008被UAC(User Account Control,用户账户控制)锁定了. 你需要用管理员(Administrator)账户执行这个程序. 另一种方式是设置运行此程序的账户拥有如下权限: Logon as a Service"/ "Logon as a Batch Job"
来自: 昵称10504424 > 《工作》
0条评论
发表
请遵守用户 评论公约
ystem.Runtime.InteropServices.COMException (0x800A1066): 命令失败
(D:\web\temp\63384007.html) 在 Microsoft.Office.Interop.Word.Selection.InsertFile(String FileName, Object& Range, Object& ConfirmConversions, Object& Link, Object& Attach...
IIS7下,显示PHP错误(how to display php errors on ii...
事实上,我们都知道设置php显示错误,但是在iis7/7.5下,还需要额外的配置。首先看php的配置:代码如下:iis的配置, 注意你首先需要在你的网站根目录添加web.config文件:代码如下:LinkId=169433 --...
System.Runtime.InteropServices.COMException (0x800A141F): Word 无法读取文档,文档可能损坏。
System.Runtime.InteropServices.COMException (0x800A141F): Word 无法读取文档,文档可能损坏。 请尝试下列方法: * 打开并修复文件。 * 用文本恢复转换器打开文件。
水晶报表 - COMException (0x800003e5): 打开报表失败 - oi...
[COMException (0x800003e5): 打开报表失败。] CrystalDecisions.ReportAppServer.ClientDoc.ReportClientDocumentClass.Open(Object& DocumentPath, Int32 Options) +0 CrystalDecisions.Re...
Runtime Error R6034
Runtime Error R6034Runtime Error R6034.输入for %1 in (%windir%\system32\*.dll) do regsvr32.exe /s %1,以前刷的时候好好的,可是...
500 Internal Server Error 解决方法
您可能感兴趣的文章:Winxp IIS5.1出现HTTP500内部服务器错误的解决方法提示“处理URL时服务器出错”和“HTTP 500错误“的解决方法IIS 运...
解决runtime error R6025的办法
解决runtime error R6025的办法。一、故障现象:1、360软件的木马查杀、漏洞修复等组件不能使用,提示runtime error2、暴风影音等很多软...
Runtime Error
Runtime Error Server Error in ''/wfMedMirror'' Application.Config Configuration File --> <configuration> <system.web> <customErrors mode="Off"/...
210集 电脑在使用中出现runtime error错误该怎么解决?
微信扫码,在手机上查看选中内容