Dot Net Framework dependency issue

  .net-4.0, c++

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:WindowsMicrosoft.NETFramework64v4.0.30319mscorlib.dll

C:WINDOWSMicrosoft.NETassemblyGAC_MSILSystemv4.0_4.0.0.0__b77a5c561934e089System.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?

Source: Windows Questions C++

LEAVE A COMMENT