.Net5 sdk安装了为什么不能选择创建项目
.Net5 sdk is installed but why can't choose to create project
最近安装了.net core sdk 3.1和5版本,今天用.net5版本的时候,发现无法select创建项目时的版本,只有3.1版本。于是我打开终端,输入命令:dotnet --list-sdks查询我安装的所有版本,发现只显示3.1.405[C:\Program Files\dotnet\sdks]。这是什么原因?我确定我安装了 .net5 的 sdk。我从这个网站得到它。
https://dotnet.microsoft.com/en-us/download/visual-studio-sdks
I recently installed versions of .net core sdk 3.1 and 5. When using
the .net5 version today, I found that I couldn't select the version
when I created the project, only version 3.1
问题可能与 Visual Studio 版本有关。从Asp.net core document and the SDK download page可以看出,要使用Asp.net5,需要Visual Studio2019 16.8或更高版本:
所以,你可以将VS 2019版本升级到Visual Studio2019 16.11.9版本或者Visual Studio2022,然后在Visual StudioInstaller中点击“Modify”按钮已安装的 Visual Studio,在弹出窗口 window 中,转到 Individual components 面板,选中 .NET 5.0 runtime 选项:
然后在使用Visual Studio创建新应用程序时,您可以选择.Net 5.0版本。
最近安装了.net core sdk 3.1和5版本,今天用.net5版本的时候,发现无法select创建项目时的版本,只有3.1版本。于是我打开终端,输入命令:dotnet --list-sdks查询我安装的所有版本,发现只显示3.1.405[C:\Program Files\dotnet\sdks]。这是什么原因?我确定我安装了 .net5 的 sdk。我从这个网站得到它。
https://dotnet.microsoft.com/en-us/download/visual-studio-sdks
I recently installed versions of .net core sdk 3.1 and 5. When using the .net5 version today, I found that I couldn't select the version when I created the project, only version 3.1
问题可能与 Visual Studio 版本有关。从Asp.net core document and the SDK download page可以看出,要使用Asp.net5,需要Visual Studio2019 16.8或更高版本:
所以,你可以将VS 2019版本升级到Visual Studio2019 16.11.9版本或者Visual Studio2022,然后在Visual StudioInstaller中点击“Modify”按钮已安装的 Visual Studio,在弹出窗口 window 中,转到 Individual components 面板,选中 .NET 5.0 runtime 选项:
然后在使用Visual Studio创建新应用程序时,您可以选择.Net 5.0版本。