2015-06-08 89 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相關端口也必須在防火牆處打開。

相關問題