Nottoc
Nottoc

Reputation: 105

InstallUtil claiming could not find file or assembly or dependency missing

Just had this happen. And we found an interesting solution.

The command (run from an admin cmd window, while the current directory is where the file is located):

InstallUtil MyService.exe

Returned the error: System.IO.FileLoadException: Could not load file or assembly 'file:///C:\MyDir\MyService.exe' or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515)

Well apparently (sometimes) when a file is copied across the network Windows locks the file. At the bottom of the general tab of the properties dialog for the EXE there's a little message: The file came from another computer and might be blocked to help protect this computer. And there's a nice little checkbox that can be toggled to permit the program to run.

Hopefully all that will be enough to help someone in a similar situation. But, there remains a question.

Why sometimes? What criteria does it use? This particular service has been copied to more than 100 boxes. This is the first time we've seen this. So, it's not just because it's an EXE. Could it be the manner it was copied? Just guessing, maybe someone will know.

Upvotes: 0

Views: 72

Answers (0)

Related Questions