ServerManger exception: value cannot be null. Parameter name: type
I try to create instance of ServerManager (Microsoft.Web.Administration.dll) to get IIS Web Applications list. Code is running on the Windows 2008 Server, ASP.NET, IIS7. IIS located on the same machine. But on this line
var serverManager = new ServerManager();
I get exception:
System.ArgumentNullException: Value cannot be null. Parameter name: type
at System.Activator.CreateInstance(Type type, Boolean nonPublic)
at Microsoft.Web.Admin开发者_如何转开发istration.ConfigurationManager..ctor(ServerManager owner, String applicationHostConfigurationPath)
at Microsoft.Web.Administration.ServerManager..ctor(String applicationHostConfigurationPath)
What can I do?
精彩评论