Reputation: 1
I have created a windows service and would like to test it however when I attempt to try and install the service using the developer command prompt I get this error:
Exception occurred while initializing the installation: System.IO.FileNotFoundException: Could not load file or assembly 'file:///C:\Program Files (x86)\Microsoft Visual Studio 14.0\BackUpService.exe' or one of its dependencies. The system cannot find the file specified..
the command i used was: installutil BackUpService.exe
I am not quite sure why I am getting this?
Upvotes: 0
Views: 4272
Reputation: 883
It's look like you just forgot install(-i) word.
C:\Windows\Microsoft.NET\Framework64\v4.0.30319>InstallUtil.exe -i C:\BackupProject\bin\Debug\BackupService.exe
Use -u for uninstall.
There is complete process of install & uninstall Windows Service on this link: https://stackoverflow.com/a/51788260/9888476
Upvotes: 2
Reputation: 36
According to my understanding you are using InstallUtil.exe to install the windows service. In that case you have to specify full path of the windows service exe file in the command.
Like this
>InstallUtil.exe "C:\dev\DBBackupService\BackUpService.exe"
Hopefully this will work.
Upvotes: 0
Reputation: 10918
One way of figuring out what's missing here is by using Process Monitor. You would want to use the icons on the top right to limit the captured events to "Show File System Activity" only otherwise you'll get heaps of irrelevant information.
Upvotes: 0