Creating a .NET Core Solution for an older version of .NET Core

For much of my code I use the .NET Core LTS versions. Although the latest version at the time of writing is an LTS (v6) I can’t use it fully as I still have VS 2019 installed. As a result I target the previous LTS i.e. v3.1.

The simplest way for me to set this up is to declare the framework as a parameter. So if I am creating an MVC application for example I would use

dotnet new mvc --framework netcoreapp3.1

The framework option is a parameter of the mvc template and it takes the target framework moniker (TFM) as shown above.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Steve Ellwood

Senior Integrations Officer at Doncaster Council Any views expressed are entirely my own.