MATLAB: Does the installed application which uses the MCR fail to work, even though it worked inside Visual Studio

-setupinstalllibraryMATLAB Builder NEMATLAB Compilermclmcrrtmsi

I have a .NET application which uses a MATLAB generated .NET component. This works fine from inside Visual Studio. However, if I create an installer for the program, install it, and try to run from the installation folder, it fails to initialize the MCR.

Best Answer

This is due to Visual Studio including "mclmcrrt.dll" in the installer program. The DLL is then copied into the installation folder and that copy gets used when you run the installed application. Because it is not located in the correct place, the MCR fails to initialize.
To resolve this issue, please remove the DLL from the setup project so that the DLL installed with the MCR is used.