我需要访问远程计算机上的远程iis,当我尝试访问它时,它实际上可以正常工作,在浏览器中为我的本地计算机提供ip +端口,并且iis似乎可以正常工作,并且可以使用iis Manager界面。
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的桌面应用程序
答案 0 :(得分:0)
尝试执行以下步骤:
1)从您的计算机中打开搜索并键入DCOMCNFG。
2)在组件服务窗口中,右键单击我的电脑,然后选择属性。 选择“ COM证券”标签。
2)在“访问权限”中,单击“编辑默认值”,然后向其中添加“网络服务”,并为其赋予“允许本地访问”权限。对
3)在“启动和激活权限”中,单击“编辑默认值”,然后向其中添加“网络服务”,并为其授予“本地启动和本地激活”权限。对