visual-studio-2010 - 安装项目想要安装 .NET 4 两次

标签 visual-studio-2010 .net-4.0 setup-project

我有一个用 VS2010 制作的简单安装项目。一个可执行文件,几个 dll,非常简单。

我将我的 setup.exe 和 .msi 移动到一个干净的测试机器上,在启动 setup.exe 之后,我获得了 .NET 4 的 EULA,然后下载了“.Net Framework 4 客户端配置文件(x86 和 x64)”和(据说)安装。安装程序要求重新启动,我重新启动,然后终于可以安装我的应用程序了。我启动它,然后我得到这个窗口:

enter image description here

单击"is"会将我带到这个 page .

安装 .NET Framework 4.0 完成交易,这次不需要重新启动。

所有构建的 DLL 和 EXE 都将 .NET 4 作为项目属性中的目标框架(无客户端配置文件),除了一个具有 .NET 3.5 的 DLL

为什么要双重安装?如何让它在向导中安装一次?

最佳答案

设置创建时有一个警告(愚蠢的我,没看到!):

The target version of the .NET Framework in the project does not match the .NET Framework launch condition version '.NET Framework 4 Client Profile'. Update the version of the .NET Framework launch condition to match the target version of the.NET Framework in the Advanced Compile Options Dialog Box (VB) or the Application Page (C#, F#).

place有答案:

1) select installer project

2) click on the icon on top "Launch Conditions Editor" its the icon with a binoculars.

3) Under Launch Conditions, Select ".Net framework" on the right in "Properties" Select "Version" you will see a drop down. change the framework to your target framework.


更新

默认情况下,安装项目似乎是使用 .NET Framework 4 客户端配置文件创建的,并且必须在两个 地方将其更改为“无配置文件”。上面和安装项目的属性中提到的那个。

  1. 选择安装程序项目
  2. 转到属性(右键单击 -> 属性)
  3. 进入先决条件...
  4. 取消选中“Microsoft .NET Framework 4 客户端配置文件(x86 和 x64)”并选中“Microsoft .NET Framework 4(x86 和 x64)”

关于visual-studio-2010 - 安装项目想要安装 .NET 4 两次,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7487268/

相关文章:

visual-studio-2010 - Visual Studio 数据库项目和 SQL Azure

c# - 如何调试与低级 API(如 I/O 完成端口)交互的代码?

c# - 选择哪个对象池后备存储?

wpf - 从选项卡内部将选项卡添加到选项卡控件

.net - 更改整个 Windows 窗体应用程序的当前区域性 .NET Compact Edition

c# - 整个解决方案的 C# 类图

c# - 如何创建一个包含对象值的字符串?

asp.net-mvc - 在 .NET MVC 3 中使用 REST Web 服务

visual-studio - 在 Visual Studio 安装项目中,如何根据复选框对话框更新注册表?

visual-studio - 尝试制作 Windows 安装程序包时 Visual Studio 的奇怪行为