DirectoryEntry配置IIS7出現(xiàn)ADSI Error:未知錯誤(0x80005000)
一、錯誤情況
環(huán)境:win7+iis7.0
DirectoryEntry配置IIS7出現(xiàn)如下錯誤
或者是
下面一段代碼在IIS6.0下運轉(zhuǎn)正常,但I(xiàn)IS7.0下運轉(zhuǎn)會出錯:
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)
二、錯誤分析
這段異常代碼表明 IIS://localhost/W3SVC/1 的ADSI provider不存在或者無法訪問。
打開IIS管理器你可以看到服務(wù)器的localhost(即默認(rèn)站點)是存在的并正在運行,且主站點ID確實是1。這說明問題是出現(xiàn)在 IIS://localhost的ADSI provider。
三、錯誤原因
win7使用的是iis7,而IIS 7默認(rèn)并沒有安裝ADSI provider。
四、解決方法
要解決這個問題就得安裝“IIS 元數(shù)據(jù)庫和IIS 6配置兼容性”。
“控制面板”->“程序和功能”->面板左側(cè)“打開或關(guān)閉windows功能”->“Internet信息服務(wù)”->“Web管理工具”->“IIS 6管理兼容性”->“IIS 元數(shù)據(jù)庫和IIS 6配置兼容性”。
如下圖所示:
五、Windows Server 2008出現(xiàn)這種錯誤怎么辦?
在Windows Server 2008下,使用角色服務(wù)安裝完“IIS 元數(shù)據(jù)庫和IIS 6配置兼容性”,還有可能出現(xiàn)如下錯誤:
[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)賬戶執(zhí)行這個程序. 另一種方式是設(shè)置運行此程序的賬戶擁有如下權(quán)限: Logon as a Service"/ "Logon as a Batch Job"
以上就是解決DirectoryEntry配置IIS7出現(xiàn)ADSI Error錯誤的方法,還有引申出來的Windows Server 2008出現(xiàn)這種錯誤的解決辦法,希望對大家解決這類問題有所幫助。
- IIS7.0 運行ASP 500錯誤 解決方法
- WIN2008系統(tǒng)安裝IIS7配過ASP后打開ASP網(wǎng)站為500錯誤的解決辦法
- IIS7.5顯示ASP的詳細(xì)錯誤信息"500 – 內(nèi)部服務(wù)器錯誤解決"
- IIS7使用.NET Framework v4.0運行庫報500錯誤的解決辦法
- Win7 IIS7.5運行ASP時出現(xiàn)500錯誤的解決辦法
- IIS7.5中調(diào)試.Net 4.0網(wǎng)站出現(xiàn)無厘頭、500錯誤的解決方法
- IIS7.5 HTTP 錯誤 500 調(diào)用loadlibraryex失敗的解決方法
- IIS7.5 Error Code 0x8007007e HTTP 錯誤 500.19的解決方法
- IIS7/iis7.5 HTTP Error 500.19 配置錯誤由于權(quán)限不足而無法讀取配置文件的解決辦法
- IIS7報500.23錯誤的原因分析及解決方法
相關(guān)文章
UnityShader3實現(xiàn)轉(zhuǎn)圈與冷卻效果
這篇文章主要為大家詳細(xì)介紹了UnityShader3實現(xiàn)轉(zhuǎn)圈與冷卻效果,文中示例代碼介紹的非常詳細(xì),具有一定的參考價值,感興趣的小伙伴們可以參考一下2019-03-03C#實現(xiàn)將HTML轉(zhuǎn)換成純文本的方法
這篇文章主要介紹了C#實現(xiàn)將HTML轉(zhuǎn)換成純文本的方法,基于自定義類實現(xiàn)文本轉(zhuǎn)換功能,具有一定參考借鑒價值,需要的朋友可以參考下2015-07-07C#用遞歸算法實現(xiàn):一列數(shù)的規(guī)則如下: 1、1、2、3、5、8、13、21、34,求第30位數(shù)是多少
本文主要介紹三種方法,解決面試中常見的問題,求第30位數(shù)是多少的問題,希望能給大家一個參考。2016-06-06c#讀取圖像保存到數(shù)據(jù)庫中(數(shù)據(jù)庫保存圖片)
這篇文章主要介紹了使用c#讀取圖像保存到數(shù)據(jù)庫中的方法,大家參考使用吧2014-01-01picturebox加載圖片的三種方法與網(wǎng)站驗證碼的抓取
這篇文章主要介紹了picturebox加載圖片的三種方法與網(wǎng)站驗證碼的抓取,需要的朋友可以參考下2015-03-03深入多線程之:內(nèi)存柵欄與volatile關(guān)鍵字的使用分析
本篇文章對內(nèi)存柵欄與volatile關(guān)鍵字的使用進行了詳細(xì)的分析介紹,需要的朋友參考下2013-05-05