[英]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 个地方需要添加此更改。
Main Project(Properties(Right Click) > Application > Target Framework > Select version of desire Framework)主项目(属性(右键单击)>应用程序>目标框架> Select版本的desire Framework)
Setup project(Properties(Right Click) > Prerequisites(Click) > Select version of desire Framework)设置项目(Properties(右击)> Prerequisites(点击)> Select 版本的desire Framework)
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.