zoukankan      html  css  js  c++  java
  • DirectoryEntry配置IIS出现ADSI Error:未知错误(0x80005000)

    目录

    问题案例

    原因分析

    解决问题

    总结

    问题案例

    DirectoryEntry配置IIS,在IIS6.0下运转正常,但IIS7.0下运转会出错: 

    System.DirectoryServices.DirectoryEntry iisServer;
    iisServer = 
    new System.DirectoryServices.DirectoryEntry("IIS://LOCALHOST/W3SVC/");//此处抛出异常

    异常内容如下: 

    System.Runtime.InteropServices.COMException (0x80070003): 系统找不到指定的路径。
    
       在 System.DirectoryServices.DirectoryEntry.Bind(Boolean throwIfFail)
       在 System.DirectoryServices.DirectoryEntry.Bind()
       在 System.DirectoryServices.DirectoryEntry.get_IsContainer()
       在 System.DirectoryServices.DirectoryEntries.ChildEnumerator..ctor(DirectoryEntry container)
       在 System.DirectoryServices.DirectoryEntries.GetEnumerator()

    原因分析

    排除原因 :IIS6的管理兼容性。

    因为在 “控制面板”->“程序和功能”->面板左侧“打开或关闭windows功能”->“Internet信息服务”->“Web管理工具”->“IIS 6管理兼容性”。已全部打钩。

    有查到资料说是这方面的原因

    解决问题

     在网上找了各种方式,但是始终不得人意。最后发现了DirectoryEntry的入参有如下区别:

    DirectoryEntry appPools = new DirectoryEntry(“IIS://LOCALHOST/W3SVC/”);   //报错
    /*
     其他操作
    */
    
    DirectoryEntry appPools = new DirectoryEntry(“IIS://LOCALHOST/W3SVC”);   //正常
    /*
     其他操作
    */

     

     

    总结

        解决了之后,再看一眼简直惊呆了....真的是一符之差( ⊙o⊙ )哇

  • 相关阅读:
    MD5 SHA1 CRC32
    tf 常用函数 28原则
    matplotlib 28原则
    markdown 基本语法
    tf 数据读取
    django 自定义身份认证
    代理部署
    社区发现算法问题&&NetworkX&&Gephi
    机器学习中的数学——拉格朗日乘子法
    过拟合(Overfitting)和正规化(Regularization)
  • 原文地址:https://www.cnblogs.com/xiaotiannet/p/3435574.html
Copyright © 2011-2022 走看看