DirectoryEntry configuration IIS7 ADSI Error: unknown error (0x80005000)
1. Error situation
Environment: win7+iis7.0
DirectoryEntry configuration IIS7 has the following error
or
The following code runs normally under IIS6.0, but an error occurs when running under IIS7.0:
System.DirectoryServices.DirectoryEntry iisServer; iisServer = new System.DirectoryServices.DirectoryEntry("IIS://localhost/W3SVC/1"); System.DirectoryServices.DirectoryEntry rootFolder = iisServer.Children.Find("Root","IIsWebVirtualDir");//此处抛出异常
The exception content is as follows:
[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)
2. Error analysis
This exception code indicates that the ADSI provider of IIS://localhost/W3SVC/1 does not exist or cannot be accessed .
Open IIS Manager and you can see that the server's localhost (default site) exists and is running, and the main site ID is indeed 1. This indicates that the problem is with the ADSI provider at IIS://localhost.
3. Cause of the error
win7 uses iis7, and IIS 7 does not have ADSI provider installed by default.
4. Solution
To solve this problem, you must install "IIS Metabase and IIS 6 Configuration Compatibility".
"Control Panel"->"Programs and Features"->"Turn Windows features on or off" on the left side of the panel->"Internet Information Services"->"Web Management Tools"-> "IIS 6 Management Compatibility" -> "IIS Metabase and IIS 6 Configuration Compatibility".
As shown below:
ErrorCode 0x80070005
Access is denied.
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)

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

