ServerManger 异常:值不能为空。参数名称:类型
我尝试创建 ServerManager (Microsoft.Web.Administration.dll) 实例来获取 IIS Web 应用程序列表。代码运行在Windows 2008 Server、ASP.NET、IIS7上。 IIS 位于同一台计算机上。 但在这一行
var serverManager = new ServerManager();
我得到了例外:
System.ArgumentNullException: Value cannot be null. Parameter name: type
at System.Activator.CreateInstance(Type type, Boolean nonPublic)
at Microsoft.Web.Administration.ConfigurationManager..ctor(ServerManager owner, String applicationHostConfigurationPath)
at Microsoft.Web.Administration.ServerManager..ctor(String applicationHostConfigurationPath)
我能做什么?
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.Administration.ConfigurationManager..ctor(ServerManager owner, String applicationHostConfigurationPath)
at Microsoft.Web.Administration.ServerManager..ctor(String applicationHostConfigurationPath)
What can I do?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论