3

I am trying to install a web service which is basically a file watcher service. But when I try to run this command Installutil –i "C:\\xxx\zzzz\ServiceTest.exe"

I get this error System.IO.FileNotFoundException: Could not load file or assembly 'file:///C:\Windows\Microsoft.NET\Framework\v4.0.30319\-i

I used to run this command before and I never got this error, I don't know what is different this time.

John Saunders
  • 160,644
  • 26
  • 247
  • 397
CPM
  • 213
  • 2
  • 7
  • 23

7 Answers7

6

Try running

c:\Windows\Microsoft.NET\Framework\v4.0.30319\InstallUtil.exe -i "C:\xxx\zzzz\ServiceTest.exe"

The response you received doesn't make sense unless "installutil" has been redefined.

John Saunders
  • 160,644
  • 26
  • 247
  • 397
5

I get the same error if I download the windows10manager.exe (exe service sample) from the Internet. After I download the file, I go to file properties and I click in unblock button. After this operation, the service install successfuly. To automate this process, follow this thread: Unblock File from within .net 4 c#

enter image description here

1

Check the spelling of the service path specially the (") quote character write it and don't copy paste.

This works with me.

Youssef Wagih
  • 121
  • 1
  • 8
0

Change the compiler settings in Visual Studio from X86 to Any CPU or use the 64 bit InstalUtil inside "C:\Windows\Microsoft.NET\Framework64\v4.0.30319"

Razvan Trifan
  • 534
  • 2
  • 6
0

Maybe some of your refereneced DLLs are still 32bit? You can check it with free tool depends.exe from Microsoft

0

In my case, this error occur because the are some blank space in my project path e.g.: C:\user\Visual Studio 2019....

When I rename my path by deleting space, it worked fine

Waqar UlHaq
  • 6,144
  • 2
  • 34
  • 42
hamil.Dev
  • 137
  • 2
  • 9
-1

I had same problem, because the service name was only "Service.exe", so i change to C:\MyServices\NewService\Service.exe"

Wrong: C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\installutil /u Service.exe

Correct: C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\installutil /u "C:\MyServices\NewService\Service.exe"

works for me!