So Let me tell you that I am developing a IIS monitoring Website in MVC 5
I try to stop an application within C# code but it always throw exception. mentioned in the title.
I am using code:
ServerManager manager = new ServerManager(@"C:\Windows\System32\inetsrv\config\applicationHost.config");
foreach (Site site in manager.Sites)
{
site.Stop();
}
The exception is:
{"The method or operation is not implemented."}
at Microsoft.Web.Administration.Interop.IAppHostMethodInstance.Execute()
at Microsoft.Web.Administration.ConfigurationMethodInstance.Execute()
at Microsoft.Web.Administration.ConfigurationElement.ExecuteMethod(String methodName)
at Microsoft.Web.Administration.Site.Stop()
at WebsiteReplication.Repository.IISConfiguration.VerifyWebsites(List`1 websitesDirs) in e:\RLTSquare\MetisSilverlight\Code\WebsiteReplication\WebsiteReplication\Repository\IISConfiguration.cs:line 67
What I have read uptil now that I need to run my website under administrator privilages. I did that also, I also tried to add manifest file and than changing the access level by this line of code
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
Nothing is not working. As I cannot add this manifest file to MVC application because the combobox under properties of the project does not show menifest file there.
I want to list all websites from IIS server in my MVC application. Also I need to stop/start website from my MVC application.