一、错误情况

环境: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.COMException
ErrorCode 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"

http://blog.csdn.net/ts1030746080/article/details/8741399

[转载]DirectoryEntry配置IIS7出现ADSI Error:未知错误(0x80005000)的更多相关文章

  1. DirectoryEntry配置IIS7出现ADSI Error:未知错误(0x80005000)

    一.错误情况 环境:win7+iis7.0 DirectoryEntry配置IIS7出现如下错误 或者是 下面一段代码在IIS6.0下运转正常,但IIS7.0下运转会出错: System.Direct ...

  2. DirectoryEntry配置IIS7出现ADSI Error:未知错误(0x80005000) [转]

    一.错误情况 环境:win7+iis7.0 DirectoryEntry配置IIS7出现如下错误 或者是 下面一段代码在IIS6.0下运转正常,但IIS7.0下运转会出错: System.Direct ...

  3. DirectoryEntry配置IIS出现ADSI Error:未知错误(0x80005000)

    目录 问题案例 原因分析 解决问题 总结 问题案例 DirectoryEntry配置IIS,在IIS6.0下运转正常,但IIS7.0下运转会出错: System.DirectoryServices.D ...

  4. [转载]开机出现A disk read error occurred错误

    [此文章转载] 今天维修了一台机器,郁闷之极.最开始一直无法正确安装操作系统,一安装总是提示文件无法写入内存.换了光盘.光驱都无济于事,忽然意识到是不是内存的问题,随即找了一个内存来,替换了一下,更郁 ...

  5. IIS7/8 HTTP Error 500.19 错误 0x80070021 错误代码:0x8007000d

    nopCommerce versions 4.20 的安装环境是 dotnet-hosting-2.2.0-win.exe .net core项目iis10上出现 HTTP 错误 500.19,错误代 ...

  6. 遇到IIS7配置PHP出现403和404错误的解决办法

    服务器要配置PHP,总是出现403错误.服务器是新装的,操作系统是windows server 2008 R2,装的IIS7. IIS里PHP和本地服务器对比了好几遍,都没到出错的原因,后来通过cmd ...

  7. IIS7/8 HTTP Error 500.19 错误 0x80070021

    IIS7.0/8.0的错误HTTP Error 500.19 - Internal Server Error ,错误代码为0x80070021,大概原因为IIS7.0的安全设定相比前版本有很大的变更. ...

  8. springboot 配置jpa启动报Error processing condition on org.springframework.boot.autoconfigure.data.web.SpringDataWebAutoConfiguration.pageableCustomizer

    springboot +gradle 配置jpa启动报Error processing condition on org.springframework.boot.autoconfigure.data ...

  9. f-stack中nginx配置后make出现error: ignoring return value of ‘ftruncate’

    问题 Nginx 配置后 make 出现error: src/os/unix/ngx_process_cycle.c: In function 'ngx_start_worker_processes' ...

随机推荐

  1. WCF之服务元数据

    服务元数据是用来获得服务的EndPoint的信息,也就是它的ABC. 服务有两种方案可以发布自己的元数据. 一种是基于HTTP-GET协议提供元数据: 一种是元数据交换方式,它往往使用一个专门的终结点 ...

  2. 异常getaddrinfo enotfound

    在看NodeJS开发指南这本书时,书中的一个例子,讲解http.request的.代码如下: var http = require('http'); var querystring = require ...

  3. springside出现Description Resource Path Location Type

    <?xml version="1.0" encoding="utf-8" ?><beans xmlns="http://www.sp ...

  4. QT 信号与槽连接

    转帖 http://www.cnblogs.com/cnhome/archive/2009/10/01/1577277.html 信号(SIGNAL)和槽(SLOT)是Qt编程的一个重要部分.这个机制 ...

  5. gcc常用命令介绍

    GCC 全称是 GNU C Compiler,是gnu中最流行的c & c++编译器,下面我们看一下一些主要的参数使用方法. 对于一个源文件可以直接生成可执行文件 gcc test.c 默认生 ...

  6. mount.nfs: access denied by server while mounting localhost:/home/xuwq/minilinux/system

    在执行命令如下: mount -t nfs localhost:/home/xuwq/minilinux/system /mnt 出现的错误: mount.nfs: access denied by ...

  7. ThreadLocal学习记录

    ThreadLocal简介 当使用ThreadLocal维护变量时,ThreadLocal为每个使用该变量的线程提供独立的变量副本,所以每一个线程都可以独立地改变自己的副本,而不会影响其它线程所对应的 ...

  8. AJAX 跨域 :Access-Control-Allow-Origin

    在一个项目上想用NodeJS,在前端的JS(http://localhost/xxx)中ajax访问后端RestAPI(http://localhost:3000/….)时(Chrome)报错: XM ...

  9. MongoDB如何存储数据

    想要深入了解MongoDB如何存储数据之前,有一个概念必须清楚,那就是Memeory-Mapped Files. Memeory-Mapped Files 下图展示了数据库是如何跟底层系统打交道的. ...

  10. 【转】MyEclipse快捷键大全(绝对全)

    ref:http://www.douban.com/note/254195820/?type=like# ctrl+w 关闭单个窗口 F3 跳转到类.变量的声明 F11 运行上次程序 Ctrl + F ...