I am installing a windows service using visual studio command prompt using the following command
installutil D:\Folder1\Projectname\bin\Debug\Service1.exe
But I get the following exception
Exception occurred while initializing the installation:System.IO.FileNotFoundException: Could not load file or assembly 'file:///D:\Folder1\WIN' or one of its dependencies. The system cannot find the file specified..
Is the command wrong or Am I missing anything else?
Press Windows + R, type cmd, and hit Enter to open Command Prompt in Windows 10. Then type the Windows Services command line services. msc and hit Enter to open it.
i have the same problem, in this case Service.exe was blocked.
Solution : right-click on the file and open Properties. You may see a message – This file came from another computer and might be blocked to help protect this computer. Click on the Unblock button and then on Apply/OK
File paths with spaces in them must be quoted.
Good
installutil "c:\my directory\service1.exe"
Bad
installutil c:\my directory\service1.exe
The OS stops reading the path at the first space, causing it to look for a file named"c:\my", which does not exist.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With