Visual Studio 2013 中的 VC++ 2012 Runtime Bootstrapper 包在哪里? [英] Where is the VC++ 2012 Runtime Bootstrapper package in Visual Studio 2013?

查看:31
本文介绍了Visual Studio 2013 中的 VC++ 2012 Runtime Bootstrapper 包在哪里?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个通过 ClickOnce 部署的 .NET 4.5.2 应用程序.它使用 另一个版本的 Visual Studio 很少受到关注.

解决方案

您可以通过破解您的项目文件并复制一些文件来实现此目的.下面的示例用于在 Visual Studio 2013 中使用 Visual C++ 2012 运行时库.如果您使用不同版本的 Visual Studio 或需要不同版本的 Visual C++ 运行时库,则必须更改某些版本号.

首先将以下内容添加到您的项目文件中:

<BootstrapperPackage Include="Microsoft.Visual.C++.11.0.x64"><Visible>False</Visible><ProductName>Visual C++ 2012 运行时库 %28x64%29</ProductName><安装>真</安装></BootstrapperPackage></项目组>

以上示例适用于 64 位版本的 Visual C++ 2012 运行时库.如果要使用 32 位版本,则应将 x64 替换为 x86.如果您想使用不同版本的 C++ 库,则必须更改 11.0 版本号.如果此时打开项目并转到先决条件,您会注意到 Visual Studio 2013 找不到 Visual C++ 运行时库的警告.要解决此问题,您需要复制一些文件.

  1. 转到以下文件夹:C:Program Files (x86)Microsoft SDKsWindowsv8.0ABootstrapperPackages.如果您想要不同版本的 C++ 运行时库,您应该更改 v8.0a 版本号.
  2. 将文件夹 vcredist_x86 复制到 Visual Studio 2013 使用的文件夹:C:Program Files (x86)Microsoft SDKsWindowsv8.1ABootstrapperPackages.确保使用不同的名称以避免覆盖 2013 库.我使用了 vcredist_x64.2012.

此时您可以打开您的解决方案并发布您的解决方案.当用户安装您的应用程序时,他们还会被要求安装 C++ 运行时库.如果您的用户已经安装了该应用程序,他们将需要重新安装,否则他们将不会收到安装 C++ 运行时库的问题.

您的系统上可能没有 C:Program Files (x86)Microsoft SDKsWindowsv8.0ABootstrapperPackages 文件夹.我认为除了 Visual Studio 2013 之外,您只有在安装 Visual Studio 2012 时才会获得此文件夹.如果您知道在哪里可以下载文件而无需安装 Visual Studio 2012,请随意编辑此问题.

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.

解决方案

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 SDKsWindowsv8.0ABootstrapperPackages. 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 SDKsWindowsv8.1ABootstrapperPackages. 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 SDKsWindowsv8.0ABootstrapperPackages 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.

这篇关于Visual Studio 2013 中的 VC++ 2012 Runtime Bootstrapper 包在哪里?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆