I have a .NET 4.5.2 application that's deployed via ClickOnce. It uses the Magick.NET library, which requires the Visual C++ Redistributable for Visual Studio 2012. I've tried it with the 2013 package, but it still needs the 2012 version to work. Unfortunately, the only version listed under the possible Prerequisites in Visual Studio 2013 is the 2013 version. Other version are nowhere to be found:
How do I include the Visual C++ 2012 Runtime Libraries with my ClickOnce app in Visual Studio 2013?
EDIT: There appears to be a very similar question for another version of Visual Studio which got very little attention.
A bootstrapper package is a group of directories and files that contain manifest files that describe how the prerequisite should be installed. The bootstrapper first detects whether any of the prerequisites are already installed. If prerequisites are not installed, first the bootstrapper shows the license agreements.
The Redistributable is available in the my.visualstudio.com Downloads section as Visual C++ Redistributable for Visual Studio 2019 - Version 16.7. Use the Search box to find this version. To download the files, select the platform and language you need, and then choose the Download button.
The . NET Framework 4.6 ClickOnce Bootstrapper package updates the prerequisite components list in Visual Studio 2013 by installing the required files that enable Visual Studio 2013 to offer the . NET Framework 4.6 entry in the list of available prerequisites. When it is available, you can select the .
You can accomplish this by hacking your project file and copying some files. The example below is for using the Visual C++ 2012 Runtime libraries in Visual Studio 2013. You will have to change some version numbers if you are using a different version of Visual Studio or want a different version of the Visual C++ Runtime libraries.
First add the following to your project file:
<ItemGroup>
<BootstrapperPackage Include="Microsoft.Visual.C++.11.0.x64">
<Visible>False</Visible>
<ProductName>Visual C++ 2012 Runtime Libraries %28x64%29</ProductName>
<Install>true</Install>
</BootstrapperPackage>
</ItemGroup>
The example above is for the 64-bit version of the Visual C++ 2012 Runtime Libraries. If you want to use the 32-bit version you should replace x64 with x86. And if you want to use a different version of the C++ library you will have to change the 11.0 version number. If you open your project at this point and go to the prerequisites you will notice a warning that Visual Studio 2013 cannot find the Visual C++ Runtime Libraries. To fix this you will need to copy some files.
At this point you can open your solution and publish your solution. When users install your application they will be asked to also install the C++ Runtime libraries. If your users already installed the application they will need to reinstall otherwise they won't get the question to install the C++ Runtime libraries.
It might be possible that you don't have the C:\Program Files (x86)\Microsoft SDKs\Windows\v8.0A\Bootstrapper\Packages folder on your system. I think you only get this folder when you install Visual Studio 2012 besides Visual Studio 2013. Feel free to edit this question if you know where you can just download the files without having to install Visual Studio 2012.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With