title: Restart windows service on server (Windows 2008 R2) having UAC turned ON (from ASP.NET application)
body: <p>I am trying to restart a windows service (part of the application) from my ASP.NET (.Net 4) application but it fails with the error:</p>
  
  <pre><code>Cannot open &lt;ServiceName&gt; service on computer '.'.
  Inner Exception: Access is denied
  StackTrace:  at System.ServiceProcess.ServiceController.GetServiceHandle(Int32 desiredAccess)
     at System.ServiceProcess.ServiceController.Start(String[] args)
     at NetClient.AvailabilityConfiguration.StartAvailabilityService(ServiceController serviceName, TimeSpan timeout)
  </code></pre>
  
  <p>The code is working fine on my development machine (Windoes 7) and test server (Windows 2008 R2) but fails on the production server. The only (and BIG) difference is that UAC is turned ON the production serevr where as it is OFF on the dev and test servers.</p>
  
  <p>I have tried adding an app.manifest file to the web application to get elevated privileges but it does not seem to work. I've configured the app.manifest "requestedExecutionLevel" attribute to "requireAdministrator" but does not seem to have an effect.</p>
  
  <p>Any help will be greatly appreciated.</p>
  
  <p>Thanks
  Aju</p>