# Avoid .NET/Link error in Visual Studio 2015?

Posted 4 months ago
474 Views
|
|
1 Total Likes
|
 Hi All, Hope you are all fine. I am trying to maintain and extend the functionality of a very old C++ program (initially coded in 2009). It was using .NET/Link feature of Wolfram. However it does not have many documentation neither comments for the code. I've encountered a problem of compiling and running it with the error said: Exception thrown: 'System.TypeLoadException' in mscorlib.dll Exception thrown: 'System.DllNotFoundException' in Wolfram.NETLink.dll Exception thrown: 'System.TypeInitializationException' in Wolfram.NETLink.dll Exception thrown: 'System.TypeInitializationException' in [My Project].exe I should mention that this happens in the very first beginning of the code: kernel = nullptr; kernel = MathLinkFactory::CreateKernelLink(); And the similar problem happens to me when I was trying to run the sample code from Wolfram official platform, it is a C# program though: Exception thrown: 'System.TypeLoadException' in mscorlib.dll Exception thrown: 'System.DllNotFoundException' in Wolfram.NETLink.dll Exception thrown: 'System.TypeInitializationException' in Wolfram.NETLink.dll 'MathKernelApp.vshost.exe' (CLR v2.0.50727: MathKernelApp.vshost.exe) I am not sure if this is a problem of environment setup or it is because of the incompatibility between Wolfram and Windows 10. Operating System: Windows 10 IDE: Visual Studio 2015 Target Platform Version: 10.0.16299.0 Platfomr Toolset: Visual Studio 2015 (v140)A quick update: I have resolved problem in MathKernelApp provided by Wolfram by copying and pasting the ml64i4.dll into the Release folders. I thought it may help to my original problem but not. It is a separate problem and I still have no idea of how to fix the first one.