开发者

My service does not start on Windows 2008 (it works on Windows 2003)

开发者 https://www.devze.com 2022-12-21 17:43 出处:网络
When we install our product on Windows 2008 SP2, couple of services fail to start.After trying different things, we figured out that these service were able to start when \"Log on as\" is set to \"Loc

When we install our product on Windows 2008 SP2, couple of services fail to start. After trying different things, we figured out that these service were able to start when "Log on as" is set to "Local system account".

This service does need to run as a specific user because it requires access to secure resources. The service did run just fine under this special user account under Windows 2003. I am thinking the problem is related to UAC (user access control).

Under interactive mode one can elevate permission by answering the security dialog box. How to do the same for a service? How to configure the service so it runs with necessary permissions?开发者_如何学Go

Thanks!


Try adding an entry to your service application's assembly manifest. Include a requestedExecutionLevel of requireAdministrator:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"> 
   <assemblyIdentity version="1.0.0.0" processorArchitecture="X86" name="client" type="win32"/> 

   <description>Westwell Contoso</description> 

   <!-- Disable file and registry virtualization -->
   <trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
      <security>
         <requestedPrivileges>
            <requestedExecutionLevel level="requireAdministrator" uiAccess="false"/>
         </requestedPrivileges>
      </security>
   </trustInfo>
</assembly>

Most people run their services either as the limited LocalService or NetworkService accounts.

0

精彩评论

暂无评论...
验证码 换一张
取 消