I’m looking to setup some new projects using the web/x/app templates. I want to use the latest dotnet LTS - currently 3.1 rather than 5.0. Do I need to have .NET 5 installed so I can use the latest templates or is there another way? Is there perhaps a way to do it using Docker?
All .NET Core Templates have all been upgraded to .NET 5 since November last year.
To download a .NET Core 3.1 LTS version you can download the release before November 2020 from its releases page:
So for the empty web template: https://github.com/NetCoreTemplates/web/releases
You would use its v17 release https://github.com/NetCoreTemplates/web/releases/tag/v17
Which you can download the Source code .zip https://github.com/NetCoreTemplates/web/archive/v17.zip
But that would still have the template default of
MyApp, to have it use your project name you can use the specific .zip URL with x dotnet tool, e.g:
$ x new https://github.com/NetCoreTemplates/web/archive/v17.zip Acme
But the latest v5.x dotnet tools require .NET 5, to go back to a .NET Core 3 version you’d need to use the latest non v5 release, i.e:
$ dotnet tool install --global x --version 0.0.85
Which I’m not sure if .zip support was properly supported by then or not.
Or you can just use the latest .NET 5, it’s much cleaner / faster release than .NET Core 3.1 LTS and is going to be more compatible when the next .NET 6 LTS is released later this year.
Fantastic, many thanks for the prompt response Mythz