3

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?

MaxWave
  • 382
  • 2
  • 17
  • post the line before this, you might be having the exception in that. – Illuminati Jun 21 '11 at 09:47
  • No.I log this and check, that error in constructor. I add exception details in my post. – MaxWave Jun 21 '11 at 09:53
  • I should have using Microsoft.Web.Administration.dll from Windows server. That's work fine. When I was get error, I using Microsoft.Web.Administration.dll from Windows 7 (My Work Machine) GAC_MSI, maybe it's old assembly, or not correct... – MaxWave Jun 21 '11 at 10:27
  • @MaxWave Any luck on this? I have the same issue – OrElse Apr 01 '16 at 17:32

0 Answers0