简体   繁体   English

VS 2022 - 对于在 VS 2019 中创建的项目,无法将目标平台更改为 .Net 6.0

[英]VS 2022 - cannot change Target Platform to .Net 6.0 for a project created in VS 2019

Just installed VS 2022 on a machine, after I removed VS 2019 (VM with limited space).在我删除了 VS 2019(空间有限的虚拟机)之后,刚刚在一台机器上安装了 VS 2022。 VS 2022 installed fine. VS 2022 安装正常。 I can create a .Net 6.0 project and compile it - no problem.我可以创建一个 .Net 6.0 项目并编译它 - 没问题。 I can open the project I created in VS 2019 - and compile it - no problem.我可以打开我在 VS 2019 中创建的项目 - 并编译它 - 没问题。

But - when I try to change the Target Platform from .Net 4.6 to 6.0 - I do not see anything above .Net 4.8 in the drop down list.但是 - 当我尝试将目标平台从 .Net 4.6 更改为 6.0 时 - 我在下拉列表中没有看到高于 .Net 4.8 的任何内容。
在此处输入图片说明

This is VS 2022 - and I CAN create a new .Net 6.0 project and compile it.这是 VS 2022 - 我可以创建一个新的 .Net 6.0 项目并编译它。 在此处输入图片说明

And when I go into that New Project's Properties - I can see .Net 6.0 in the dropdown...当我进入那个新项目的属性时 - 我可以在下拉菜单中看到 .Net 6.0 ...... 在此处输入图片说明

So - I think I am missing a step to get my older 2019 project - fully upgraded to 2022. I loaded the project in 2022 - but when I look at the properties for that project, the screen looks like it did in 2019 --- but for a new project the properties screen looks VERY different (as you can see in the two screen shots attached).所以 - 我想我错过了让 2019 年旧项目的一步 - 完全升级到 2022 年。我在 2022 年加载了该项目 - 但是当我查看该项目的属性时,屏幕看起来就像 2019 年一样 ---但是对于一个新项目,属性屏幕看起来非常不同(正如您在所附的两个屏幕截图中看到的那样)。

Does anyone have any thoughts as to what steps I might be missing?有没有人对我可能缺少哪些步骤有任何想法? I loaded .Net 6.0 SDK on this machine (hence why I can create a .net 6.0 project and compile it :)我在这台机器上加载了 .Net 6.0 SDK(因此我可以创建一个 .net 6.0 项目并编译它:)
Are there other steps to making an older project work like it was created in VS 2022 - and then make it use .Net 6.0 ???是否还有其他步骤可以使旧项目像在 VS 2022 中创建的那样工作 - 然后使用 .Net 6.0 ???

Any thoughts would be much appreciated!!任何想法将不胜感激!

There is no direct upgrade from .NE Framework (any version) (but there is a tool for some types of projects) to anything .NET Core.没有从 .NE Framework(任何版本)(但有适用于某些类型项目的工具)直接升级到任何 .NET Core。 And .NET 5 & 6 are based on Core. .NET 5 & 6 基于 Core。

Aiitionally, VS2019 does not support .NET 6 (as of .NET 6 RTM). Aiitionally,VS2019 不支持 .NET 6(从 .NET 6 RTM 开始)。 You need VS2022 for that.为此,您需要 VS2022。

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

相关问题 无法在 VS 2019 或 2022 中添加 .NET 项目引用 - Unable to add .NET project reference in VS 2019 or 2022 主动解决方案平台VS Project Platform VS Platform目标 - Active solution platform VS Project Platform VS Platform target 如何使用 .NET Framework 6.0 配置 VS 2022? - How do I configure VS 2022 with .NET Framework 6.0? .NET 6.0 web 应用程序在 VS2022 中调试非常慢 - .NET 6.0 web app very slow debugging in VS2022 当项目 .NET 6.0 引用子模块项目 .netstandard2.0 时,找不到 VS 2022 元数据文件“C:\*\crypto.dll” - VS 2022 Metadata file 'C:\*\crypto.dll' could not be found when a project .NET 6.0 reference a submodule project .netstandard2.0 如何让 VS 2022 VSIX 项目在 2019 年运行? - How to make a VS 2022 VSIX project work in 2019? 在 VS 2022 和 2019 Microsoft.DotNet.MSBuildSdkResolver 中加载项目时出错 - Error loading project in VS 2022 and 2019 Microsoft.DotNet.MSBuildSdkResolver 如何在 VS2019(版本 16.8.0)中将“移动应用程序(Xamarin.Forms)”项目定位到 .net 5.0? - How to target "Mobile App(Xamarin.Forms)" project to .net 5.0 in VS2019 (Version 16.8.0)? 无法从我的 ASP.Net 项目上的 VS2019 连接到 SQL 服务器数据库 - Cannot connect to SQL Server database from VS2019 on my ASP.Net project VS 2022 WCF 服务应用程序项目模板不适用于 Net TCP - VS 2022 WCF Service Application project template not working with Net TCP
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM