2
votes

I am installing windows service using installutil.exe and got the following error.

C:\Windows\Microsoft.NET\Framework\v4.0.30319>InstallUtil.exe D:\WindowsService1 .exe;

Microsoft (R) .NET Framework Installation utility Version 4.0.30319.33440 Copyright (C) Microsoft Corporation. All rights reserved. Exception occurred while initializing the installation: System.IO.FileNotFoundException: Could not load file or assembly 'file:///D:\Win dowsService1.exe;' or one of its dependencies. The system cannot find the file s pecified..

My file is located in exactly that location.

2
It says "or one of its dependencies". Are you sure all assemblies needed to run your service are copied next to it or registered in GAC? - Marcel N.
maybe you mistyped the path or name. or you are missing DLL - meda

2 Answers

1
votes

install your service with sc command. open an CMD with admin permission and run following command to install.

SC create WindowsService1 displayname= "WindowsService1" binpath= "D:\WindowsService1.exe" start= auto
0
votes

Fist thing I see is the space before ".exe" but that is probably a type here on the site. What you could do is build the service with all reference set "copy local" to true, and copy the entire bin folder to the machine you need to publisch