Home > Net >  go back to the old template Visual Studio Code C#
go back to the old template Visual Studio Code C#

Time:12-01

Hi i'm learning c# but when i run my first app with visual studio code i've this code

    // See https://aka.ms/new-console-template for more information
Console.WriteLine("Hello, World!");

How can i go back to the old template?

CodePudding user response:

Here is the easiest way to do it:

  1. Create a new console application targeting .NET5
  2. Right click on your project and find Edit project file. Click into that.
  3. Optional: Change <TargetFramework>net5.0</TargetFramework> to <TargetFramework>net6.0</TargetFramework>
  4. Save changes.

Done. By taking those steps, you start with the old template and if you want to target the new .NET6 framework, step 3 is how you can do that.

Edit: Optionally, steps 2 & 3 can also be done as follows:

  1. Right click on your project and click on Properties
  2. Optional: Under tabs Application > General find Target framework. Click the dropdown and choose .NET6
  • Related