My program uses functions from my C ++ / CLI library. The dll is always in the same folder as exe's. The program runs without problems on ~ 20 different computers (OS from Win7 to 10). But yesterday, installing the program on a computer with Win7, caught such an exception when trying to use the dll functionality:

System.IO.FileNotFoundException: Could not load the file or assembly 'MyDllName.dll' or one of its dependencies. The specified module could not be found.

At first I thought that there were not enough dependencies on the dll. Checked by Dependensy Walker'om-all dependent dll in place. And if you delete the library from the program folder, you will get a slightly different error:

System.IO.FileNotFoundException: Could not load or assembly 'MyDllName, Version = 0.0.0.0, Culture = neutral, PublicKeyToken = null' or one of its dependencies. Cannot find the specified file.

How to fix this error? well, or at least in which direction to dig?

PS: I tried to reproduce the error on the virtual machine: I installed the same OS, .Net. Created a user with minimal permissions. I started the program, all the rules.

  • Dig: Properties - Security - Permissions - Igor
  • @Igor on the folder with the program the user has full access. - Alexey
  • Try running the program using "Run as Administrator". - Igor
  • @Igor today will not work this requires local administrators whose work day is already finished. However, here is another point: I threw all the system dlls into my program folder on which my library depends and still the same error ... If the program works correctly when started from the administrator, then what? In the future, the program at startup should not require elevation to the administrator. What else can be settings that can affect the operation of the program? - Alexey
  • 2
    Add logging. In the exception, look at the fusion log, there is usually important information about what the system tried to do and what it did not work out. But this is if the problem is in the .NET part. - VladD 4:05 pm

0