Let's say that I'm using Core 3.0 with Blazor templates installed
My VS  updated and downloaded sdk 3.1 preview X and now my dotnet cli works in 3.1 preview by default
so using dotnet new doesn't show my installed Blazor templates  that I installed while using 3.0
I tried those commands to at least see name of previous templates or actually create 3.0 Blazor project, but nothing works
dotnet new --sdk-version "3.0.100-preview7-012821"
dotnet new --framework "netcoreapp3.0"
# Invalid input switch:--sdk-version3.0.100-preview7-012821
How can I list dotnet new templates for previous sdk/framework and then actually create them?
Based on the docs on how to select the .NET version to use:
Create a global.json file in your new project folder with the following content (for .net core 2.2.203 - change to required version):
{
  "sdk": {
    "version": "2.2.203"
  }
}
From a command line cd into that folder and run:
dotnet new choose-template-name
Running any dotnet CLI command in this folder and sub-folders, will use the specified SDK.
Make sure the SDK is installed first, of course.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With