I am trying to execute windows service using following command
C:\Windows\system32>installutil.exe MyNewService.exe
but i am getting below error:
Exception occurred while initializing the installation:
System.IO.FileNotFoundException: Could not load file or assembly ‘file:///C:\Win
dows\system32\MyNewService.exe’ or one of its dependencies. The system cannot fi
nd the file specified..
I tried various blogs saying some problem with spaces and all but i cant find suitable modifications to my code.
Anybody can tell me which modifications i required?
This error is because your “installutil.exe” is not located in the “C:\Windows\system32”
This is a .NET framework file and will be found under the version of .NET framework. For example for Framework 4.0 you can find this file here: “C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319”
I will recommend opening a command prompt window and ‘cd’ into “C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319′, then execute the following command.
This should fix your issue.