简体   繁体   English

修复 WARNING: The target version of the .NET Framework in the project does not match the .NET Framework launch condition version C# Setup Project

[英]Fix the WARNING: The target version of the .NET Framework in the project does not match the .NET Framework launch condition version C# Setup Project

I received Warning in output console when deploying a project using Setup project in Visual studio 2019 and error as below.在 Visual Studio 2019 中使用安装项目部署项目时,我在 output 控制台收到警告,错误如下。 "WARNING: The target version of the .NET Framework in the project does not match the .NET Framework launch condition version '.NET Framework XXX'. 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#)." “警告:项目中 .NET Framework 的目标版本与 .NET Framework 启动条件版本‘.NET Framework XXX’不匹配。更新 .NET Framework 启动条件的版本以匹配 .NET Framework 中的目标版本高级编译选项对话框 (VB) 或应用程序页面(C#、F#)。”

I search this warning in google and found solution by myself, I will share this with you step by step.我在谷歌搜索这个警告并自己找到了解决方案,我将逐步与您分享。

警告图片

This error occurred Setup Project has higher .net framework version than Project.发生此错误安装项目具有比项目更高的 .net 框架版本。 So warning can avoid by adding compatible .net framework for both projects.( Here i change version to 4.5.2) There are 3 places this change need to add.所以警告可以通过为两个项目添加兼容的 .net 框架来避免。(这里我将版本更改为 4.5.2)有 3 个地方需要添加此更改。

  1. Main Project(Properties(Right Click) > Application > Target Framework > Select version of desire Framework)主项目(属性(右键单击)>应用程序>目标框架> Select版本的desire Framework) 主要项目变更

  2. Setup project(Properties(Right Click) > Prerequisites(Click) > Select version of desire Framework)设置项目(Properties(右击)> Prerequisites(点击)> Select 版本的desire Framework) 安装项目更改 选择愿望框架

  3. Setup Project( Detected Dependencies > Microsoft .NET Framework(Double Click) > Properties > Select version of desire Framework)安装项目(检测到的依赖项> Microsoft .NET Framework(双击)> Properties > Select version of desire Framework) 选择愿望框架

Then build the project again.然后再次构建项目。 TADA warning message won't show again. TADA 警告消息不会再次显示。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 .NET Framework 的目标版本与启动条件不匹配 - Target Version of the .NET Framework does not match Launch Condition VS 安装项目 - .Net Framework 3.5 或更高版本的启动条件 - VS Setup Project - Launch condition for .Net Framework 3.5 or higher C#版本的.NET Framework - C# - version of .NET framework 无法在VS 2015 C ++项目中更改.NET Target Framework版本 - Can't change .NET Target Framework Version in VS 2015 C++ project a.Net MSI/setup 项目可以向 .NET 框架 GAC 的版本 2 和版本 4 添加程序集吗? - Can a .Net MSI/setup project add an assembly to both version 2 and version 4 of the .NET framework GAC? 每个 C# 项目上的不同 Target.Net 框架 - Different Target .Net Framework on each C# Project 项目需要哪个版本的.NET Framework? - Which version of .NET Framework will be required for project? 如何在Visual Studio安装项目的启动条件下检查.Net Core版本 - How to check .Net Core version in launch condition of Visual studio setup project Winforms 应用程序(.NET 框架)的 C# 安装项目不创建开始菜单公司目录 - C# Setup Project for winforms app (.NET Framework) does not create start menu company directory 更新项目目标.NET框架 - Update project target .NET framework
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM