国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁(yè) > 編程 > C# > 正文

DirectoryEntry配置IIS7出現(xiàn)ADSI Error:未知錯(cuò)誤(0x80005000)

2020-01-24 01:26:47
字體:
來(lái)源:轉(zhuǎn)載
供稿:網(wǎng)友

一、錯(cuò)誤情況

環(huán)境:win7+iis7.0

DirectoryEntry配置IIS7出現(xiàn)如下錯(cuò)誤

或者是

下面一段代碼在IIS6.0下運(yùn)轉(zhuǎn)正常,但I(xiàn)IS7.0下運(yùn)轉(zhuǎn)會(huì)出錯(cuò):

System.DirectoryServices.DirectoryEntry iisServer;iisServer = new System.DirectoryServices.DirectoryEntry("IIS://localhost/W3SVC/1");System.DirectoryServices.DirectoryEntry rootFolder = iisServer.Children.Find("Root","IIsWebVirtualDir");//此處拋出異常

異常內(nèi)容如下:

[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)

二、錯(cuò)誤分析

這段異常代碼表明 IIS://localhost/W3SVC/1 的ADSI provider不存在或者無(wú)法訪問(wèn)。

打開(kāi)IIS管理器你可以看到服務(wù)器的localhost(即默認(rèn)站點(diǎn))是存在的并正在運(yùn)行,且主站點(diǎn)ID確實(shí)是1。這說(shuō)明問(wèn)題是出現(xiàn)在 IIS://localhost的ADSI provider。

三、錯(cuò)誤原因

win7使用的是iis7,而IIS 7默認(rèn)并沒(méi)有安裝ADSI provider。

四、解決方法

要解決這個(gè)問(wèn)題就得安裝“IIS 元數(shù)據(jù)庫(kù)和IIS 6配置兼容性”。

“控制面板”->“程序和功能”->面板左側(cè)“打開(kāi)或關(guān)閉windows功能”->“Internet信息服務(wù)”->“Web管理工具”->“IIS 6管理兼容性”->“IIS 元數(shù)據(jù)庫(kù)和IIS 6配置兼容性”。

如下圖所示:

 五、Windows Server 2008出現(xiàn)這種錯(cuò)誤怎么辦?

在Windows Server 2008下,使用角色服務(wù)安裝完“IIS 元數(shù)據(jù)庫(kù)和IIS 6配置兼容性”,還有可能出現(xiàn)如下錯(cuò)誤: 

[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)

這是因?yàn)?Windows Server 2008被UAC(User Account Control,用戶賬戶控制)鎖定了.  你需要用管理員(Administrator)賬戶執(zhí)行這個(gè)程序. 另一種方式是設(shè)置運(yùn)行此程序的賬戶擁有如下權(quán)限: Logon as a Service"/ "Logon as a Batch Job"

 以上就是解決DirectoryEntry配置IIS7出現(xiàn)ADSI Error錯(cuò)誤的方法,還有引申出來(lái)的Windows Server 2008出現(xiàn)這種錯(cuò)誤的解決辦法,希望對(duì)大家解決這類問(wèn)題有所幫助。

發(fā)表評(píng)論 共有條評(píng)論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 墨脱县| 平乐县| 永胜县| 互助| 丹棱县| 德格县| 绥芬河市| 杨浦区| 教育| 隆林| 边坝县| 长岛县| 汾阳市| 嘉义县| 峨山| 绵竹市| 钦州市| 基隆市| 聂荣县| 太原市| 莲花县| 邛崃市| 石渠县| 阜新市| 栖霞市| 凤冈县| 民权县| 于都县| 巴东县| 鄂托克前旗| 罗定市| 古田县| 普洱| 日照市| 新密市| 清流县| 招远市| 区。| 乐平市| 新巴尔虎右旗| 连南|