Where is the VC++ 2012 Runtime Bootstrapper package in Visual Studio 2013?

瘦欲@ 提交于 2019-12-19 08:14:44

问题


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.


回答1:


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.

  1. Go to the following folder: C:\Program Files (x86)\Microsoft SDKs\Windows\v8.0A\Bootstrapper\Packages. If you want a different version of the C++ Runtime Libraries you should change the v8.0a version number.
  2. Copy the folder vcredist_x86 to the folder that Visual Studio 2013 uses: C:\Program Files (x86)\Microsoft SDKs\Windows\v8.1A\Bootstrapper\Packages. Make sure you use a different name to avoid overwriting the 2013 libraries. I used vcredist_x64.2012.

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.



来源:https://stackoverflow.com/questions/29471775/where-is-the-vc-2012-runtime-bootstrapper-package-in-visual-studio-2013

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!