Visual Studio 2012中的Visual C ++运行时可分发2010 [英] Visual C++ Runtime Distributable 2010 in Visual Studio 2012

查看:78
本文介绍了Visual Studio 2012中的Visual C ++运行时可分发2010的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要能够使用ClickOnce在Visual Studio 2012中分发Visual C ++ Runtime Distributables 2010。如何使2010 C ++引导程序出现在VS 2012先决条件中? 2012年的引导程序已经存在。我可以同时拥有吗?

I need to be able to distribute Visual C++ Runtime Distributables 2010 in Visual Studio 2012 using ClickOnce. How do I get the 2010 C++ bootstrapper to appear in the VS 2012 Prerequisites? The 2012 bootstrapper is already there. Can I have both?

推荐答案

您可以通过黑客入侵您的项目文件并复制一些文件来实现。下面的示例用于在Visual Studio 2013中使用Visual C ++ 2012运行时库。如果您使用的是其他版本的Visual Studio或需要其他版本的Visual C ++运行时库,则必须更改某些版本号。

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>

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

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. 转到以下文件夹: 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

  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.

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

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.

在系统上没有 C:\Program Files(x86)\Microsoft SDKs\Windows\v8.0A\Bootstrapper\Packages 文件夹。我认为您只能在安装Visual Studio 2013以外的其他Visual Studio 2012时获得此文件夹。如果您知道可以在哪里下载文件而不必安装Visual Studio 2012,请随意编辑此问题。

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 2012中的Visual C ++运行时可分发2010的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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