简体   繁体   中英

How do I install a Windows Service Application

I am having a problem installing a Windows Service application on my computer. If I am successful I expect to see my service listed under Computer ManagementServices and ApplicationServices .

I first try to click on my exe. I get this message:

Cannot start service from the command line or a debugger. A Windows Service must first be installed (using installutil.exe) and then started with the ServiceExplorer, Windows Service Adminstration tool or the Net Start command.

So I tried to using the installutil tool. From a command prompt I typed installutil ooaservice.exe . I get a message

Exception occurred while initializing the installation: System.badimageformatexception: could not load file or assembly 'file///(the path to my exe follows)ooaservice.exe' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded one and cannot be loaded…

I also tried to build a setup project. The setup installs successfully but the service is not listed as a service.

There should be several versions of .NET frameworks installed on your machine, try to use the highest version of installutil to install.

On my machine it is under E:\\Windows\\Microsoft.NET\\Framework\\v4.0.30319\\InstallUtil.exe .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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