I have Visual Studio 2015 installed, and I've built a .NET 4.6 application which depends on some third-party .NET assemblies, which depend on some C++ DLLs and EXEs, which in turn depend on the Visual C++ 2012 x64 Redistributable. The SDK I'm using includes some merge modules which deploy the SDK's .NET and C++ assemblies that I depend on (but not the Visual C++ runtimes).
If the Visual C++ 2012 redistributable isn't installed on a target machine, my .NET 4.6 app crashes on startup, saying Unhandled Exception: System.IO.FileNotFoundException: Could not load file or assembly 'MyManagedDependency.dll' or one of its dependencies. The specified module could not be found.
This occurs even when I have the Visual C++ 2015 redistributables installed on the target system. So it appears that the C++ runtime dependency isn't backwards/forwards compatible.
I'm using a Visual Studio 2015 Setup Project to create the installer for my application. However, the list of installer Prerequisites I can select from doesn't include the Visual C++ 2012 Runtime Libraries. The only Visual C++ libraries I can select as setup project pre-requisites are the 'Visual C++ "14" Runtime Libraries'. I believe these are the same thing as the Visual C++ 2015 Redistributable, which isn't sufficient for my software to load.
Is there any way to add the Visual C++ 2012 runtime to the pre-requisite list for my VS2015 Setup Project installer (for example, by installing more SDKs)? Or is there another way I should be packaging the 2012 C++ runtime in my installer?
EDIT: Digging through the documentation & installer package of the third-party SDK I'm using, it looks like my application might actually only run correctly if both the Visual C++ 2010 and 2012 redistributables are present on the target system. Also I might need to install both the x86 and x64 versions. I don't think I can install all of those with merge modules since this page says:
We recommend that you not use merge modules except when you don't have to service your application and you don't have dependencies on more than one version of the DLLs. Merge modules for different versions of the same DLL cannot be included in one installer, and merge modules make it difficult to service DLLs independently of your application. Instead, we recommend that you install a Visual C++ Redistributable Package.
How can I add these older redistributables as pre-requisites for my VS2015 Setup Project?