简体   繁体   English

IIS 8及更高版本不支持Servermanager

[英]Servermanager isnt supported in IIS 8 and above

I want to check wheather an application pool is present or not in IIS.For that I use servermanager as follows--> 我想检查IIS中是否存在应用程序池。为此,我按以下方式使用servermanager->

ServerManager mgr = new ServerManager();
  if (mgr.ApplicationPools["myapplicationpoolname"] == null)
{
//My Procedure to create application pool as app pool doesnt exist
}

This works buttery smooth on IIS 7.5 and below versions.But in IIS 8 and above servermanager cannot be used the above way due to memory leak issues.I even tried the suggested workaround on MSDN as follows--> 这在IIS 7.5及以下版本上可以顺利运行,但由于内存泄漏问题,在IIS 8及以上版本中无法以上述方式使用servermanager。我什至尝试了以下MSDN上建议的解决方法->

 var mgr = ServerManager.OpenRemote("localhost");

Still no luck.I am stuck up as I am unable to use servermanager in IIS 8 and above:(Any help would be appreciated:) 仍然没有运气。由于无法在IIS 8及更高版本中使用servermanager,我陷入了困境:(任何帮助将不胜感激:)

ServerManager should work just fine in Windows 8 or above, please make sure you are referencing the right version of it located in Windows\\system32\\inetsrv. ServerManager在Windows 8或更高版本上应该可以正常工作,请确保您引用的是Windows \\ system32 \\ inetsrv中的正确版本。 Also make sure that you are not "copying a version of the DLL", this DLL should always be loaded from the GAC and references from inetsrv directory, otherwise you can run into versioning issues. 还要确保您没有“复制DLL的版本”,该DLL应该始终从GAC加载,并从inetsrv目录中引用,否则会遇到版本问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM