2015-06-08 158 views
0

我想以编程方式添加站点绑定。这里是我的代码:以编程方式添加站点绑定IIS 7.5

using (ServerManager manager = ServerManager.OpenRemote("serverName")) 
{ 
    manager.Sites["siteName"].Bindings.Add(string.Format("*:{1}:{0}.localhost", clientCode, port), "http"); 
    manager.CommitChanges(); 
} 

我收到以下错误。我如何解决这个问题?

UnAuthorizedException: Retrieving the COM class factory for remote component with CLSID {} from machine failed due to the following error: 80070005

回答

0

该帐户运行的代码必须是远程计算机的管理员,并且远程计算机上的DCOM相关端口也必须在防火墙处打开。

相关问题