C# 如何远程回收aws服务器应用程序池
我正在尝试使用以下语法远程回收aws应用程序池C# 如何远程回收aws服务器应用程序池,c#,amazon-web-services,C#,Amazon Web Services,我正在尝试使用以下语法远程回收aws应用程序池 using (DirectoryEntry appPoolEntry = new DirectoryEntry( "IIS://" + appPoolModel.ServerName + "/W3SVC/AppPools/"+appPoolModel.AppPoolName)) { appPoolEntry.Invoke("Recycle", null); appPoolEntry.Close(); } 但我得到了下面的错
using (DirectoryEntry appPoolEntry = new DirectoryEntry(
"IIS://" + appPoolModel.ServerName + "/W3SVC/AppPools/"+appPoolModel.AppPoolName))
{
appPoolEntry.Invoke("Recycle", null);
appPoolEntry.Close();
}
但我得到了下面的错误
System.Runtime.InteropServices.COMException(0x800706BA):RPC服务器不可用
对于aws服务器,我使用的服务器名称如下
"ec2-[Server Public IP].compute-1.amazonaws.com"
这有两个原因