一、错误情况

环境: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. java使用BufferedImage和Graphics实现图片合成

    package com.igoxin.weixin.custom; import java.awt.Graphics; import java.awt.image.BufferedImage; imp ...

  2. iOS-设置启动图片

    启动图片设置 设置方法一 这种方法里,默认模拟器和真机的尺寸和启动图片的尺寸相同. 通过美工提供各种尺寸的启动图片来适配屏幕的大小.这种方法要求美工提供各种屏幕大小的图片. 步骤如下: 1.如图所示, ...

  3. 【Unity3D】Unity3D之 注册表动态存取游戏存档——PlayerPrefs类

    [Unity3D]Unity3D之 注册表动态存取游戏存档--PlayerPrefs类 1.Unity3D提供了一个用于本地持久化保存与读取的类--PlayerPrefs.工作原理非常简单,以键值对的 ...

  4. hdu 1716(dfs)

    题目链接 : http://acm.hdu.edu.cn/showproblem.php?pid=1716     排列2   Problem Description Ray又对数字的列产生了兴趣:现 ...

  5. UI3_UIbarButtonItem

    // // AppDelegate.m // UI3_UIbarButtonItem // // Created by zhangxueming on 15/7/6. // Copyright (c) ...

  6. vi 命令行模式功能键

    目录 目录内容 I 切换到插入模式,此时光标位于开始输入文件处 A 切换到插入模式,并从目前光标所在位置的下一个位置开始输入文字 O 切换到插入模式,并从行首开始插入行的一行 [ctrl]+[b] 屏 ...

  7. 10款很酷的HTML5动画和实用的HTML5应用

    1.HTML5的画布花朵生成器可生成多种样式的花朵 HTML5非常流行,利用HTML5制作动画也非常方便,今天要分享一款利用HTML5 Canvas制作的花朵生成器,我们只需要在Canvas画布上点击 ...

  8. 《gpg文件加密的使用》RHEL6

    甲端: 首先是要生成一对密钥: 提示是否要生成2048个字节的密钥对:   下面都是生成密钥对时的步骤: 按“o”键开始生成密钥对: 提示要我给密钥对加个密码: 输入2次 之后密钥对的字符需要我按键盘 ...

  9. Linux磁盘与文件系统概念理解

    磁盘级别概念     这里讲的主要是网上所谓的老式磁盘,它是由一个个盘片组成的,我们先从个盘片结构讲起.如图1所示,图中的一圈圈灰色同心圆为一条条磁道,从圆心向外画直线,可以将磁道划分为若干个弧段,每 ...

  10. php foreach 操作数组的代码

    php foreach 操作数组的代码.   foreach()有两种用法:  foreach(array_name as $value)  {  statement;  }  这里的array_na ...