skip to Main Content

I with this command:

dotnet new mvc

creating an ASP.NET Core MVC project in VS Code, but since SDK version 7 is installed on my computer, the project is created with version 7.

How should I create a project with .NET Core 3.1 version?

2

Answers


  1. In your .csproj file, you can set <TargetFramework>netcoreapp3.1</TargetFramework>

    Login or Signup to reply.
  2. You can use the parameter --framework for specifying the version. Ex – if you want to build in .NET 6.0. The command will be dotnet new mvc --framework net6.0

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search