我已經升級到新服務器,並且我的控制檯應用程序嘗試在IIS 8.5(Windows 2012)中創建虛擬目錄。訪問被拒絕錯誤當我嘗試使用控制檯應用程序添加新虛擬目錄
我收到此錯誤:
[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)
我試圖讓所有的權限,但它畢竟是給錯誤按本:Getting access denied while trying to create iis application from code
您是否嘗試以管理員身份運行它? – Uriil
你可以發佈你的代碼嗎?擁有應用程序對IIS運行訪問權限的帳戶?你本地/遠程運行嗎?你是否使用提升模式(以管理員身份運行)? –
嘿Uriil,是的,我已經授權它運行它作爲管理員,但仍然問題即將到來。 – CodeSync