【发布时间】:2019-08-23 10:18:41
【问题描述】:
我需要访问远程机器上的远程 iis,当我尝试访问它时,它实际上工作正常,在浏览器中为我的本地机器提供 ip+port,iis 似乎工作正常,我可以控制它iis 管理器界面。
iis remotely access from my local machine
Ican access to the distant web site
我的问题是当我需要使用此代码时(我已经对其进行了测试,它可以完美地作为本地主机运行)我的代码向我抛出了这个异常:
System.UnauthorizedAccessException: 'Retrieving the COM class factory for remote component with CLSID {2B72133B-3F5B-4602-8952-803546CE3344} from machine RD01 failed due to the following error: 80070005 RD01.'
当我尝试调试 ServerManager 返回的内容时,它会告诉我:
'serverManager.ApplicationDefaults' threw an exception of type 'System.UnauthorizedAccessException'
注意:我已经尝试过以下链接中提到的解决方案,但它不起作用
Credentials for ServerManager.OpenRemote
更新
我忘了提到我使用的是 Microsoft.Web.Administration.dll v 7.0.0 我的应用程序是带有 WPF 的桌面应用程序
【问题讨论】:
-
该远程 API 是为 Intranet 设计的,需要打开和访问 DCOM 端口。请使用新的 IIS REST API,因为它涵盖了更多的场景并且使用更简单。
标签: c# visual-studio iis remote-server