0

Using Visual Studio 2015 I have written a C++ DLL that wraps some functions from a 3rd-party lib.

I was able to run an application using this DLL on the PC the DLL was written on.

Now running the same App that uses functions from the DLL on a new PC (Using VS 2019), the exe will not run, throwing a "System.DllNotFoundException"

I have confirmed that the DLL is in the runtime same directory as my App.

Using Dependencies (https://github.com/lucasg/Dependencies) I can see that the new PC is missing two required Framework DLLs that exist on the old, working PC:

C:\Windows\Microsoft.NET\Framework64\v4.0.30319\mscorlib.dll

C:\WINDOWS\Microsoft.NET\assembly\GAC_MSIL\System\v4.0_4.0.0.0__b77a5c561934e089\System.dll

So, i've downloaded the Dot Net Framework package containing these DLLs (dotNetFx40_Full_x86_x64.exe), however it will not install on the New PC - which reports "Same or higher version of .NET Framework 4 has already been installed on this computer"

Any suggestions how to proceed?

jason.kaisersmith
  • 8,712
  • 3
  • 29
  • 51
Black
  • 5,023
  • 6
  • 63
  • 92
  • Perhaps you can use assemblyBindings to map from 4.0.30319 to your current .Net version. This question talks about it: https://stackoverflow.com/questions/19164239/what-should-i-change-when-the-compiler-tells-me-to-consider-app-config-remappin – harleybl Sep 06 '21 at 02:44

1 Answers1

0

Using this tool

https://github.com/lucasg/Dependencies

I was able to analyse the dependencies of each DLL. In my case, I was missing not a dependency of my App, but a Dependency of it's Dependencies...

Black
  • 5,023
  • 6
  • 63
  • 92