If your .NET application uses components written in Managed C++, you face the necessity to distribute Microsoft Visual C++ Redistributable with it. If one attempts to launch such application in a system that doesn’t have the corresponding Microsoft Visual C++ Redistributable installed, the user will get a warning “This application has failed to start because the application configuration is incorrect”. Why this happens, and can that be done without installing Microsoft Visual C++ Redistributable?

With the common approach, a DLL written in Managed C++ has a dependency from Microsoft Visual C++ Runtime, DLL files from which cannot be linked statically. The traditional solution is the inclusion of Microsoft Visual C++ Redistributable in the setup file.

With BoxedApp SDK, you can emulate the availability of Microsoft Visual C++ Runtime. Right after the application is launched, before using the components compiled in Managed C++, create the files, from which the Managed C++ DLL depends (how to find paths to dependencies):

To find out, which exact DLL files does your Managed C++ DLL has dependencies from, use the depends.exe application from Visual Studio setup. Open your Managed C++ DLL in depends.exe, and you will easily find, which VC++ Runtime components it depends from: