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

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

问题描述

我有一个通过ClickOnce部署的.NET 4.5.2应用程序。它使用,对于另一个版本的Visual Studio却鲜有关注。

解决方案

您可以通过入侵项目文件并复制一些文件来完成此任务。下面的示例用于在Visual Studio 2013中使用Visual C ++ 2012 Runtime库。如果您使用其他版本的Visual Studio或想要其他版本的Visual C ++ Runtime库,则必须更改某些版本号。



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

 < ItemGroup> 
< BootstrapperPackage Include = Microsoft.Visual.C ++。11.0.x64>
< Visible> False< / Visible>
< ProductName> Visual C ++ 2012运行时库%28x64%29< / ProductName>
< Install> true< / Install>
< / BootstrapperPackage>
< / ItemGroup>

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


  1. 转到以下文件夹: C:\Program Files(x86 )\Microsoft SDK \Windows\v8.0A\Bootstrapper\Packages 。如果要使用其他版本的C ++运行时库,则应更改v8.0a版本号。

  2. 将文件夹 vcredist_x86 复制到Visual Studio 2013的文件夹中使用: C:\Program Files(x86)\Microsoft SDKs\Windows\v8.1A\Bootstrapper\Packages 。确保使用其他名称以避免覆盖2013库。我使用了 vcredist_x64.2012

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



您可能有可能在系统上没有 C:\Program Files(x86)\Microsoft SDKs\Windows\v8.0A\Bootstrapper\Packages 文件夹。我认为您只能在安装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 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.

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

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