New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prefer to use project templates created in previous .NET versions #27065
Comments
My PC Setup: I am just starting out my dotnet journey and started a course on LinkedIn Learning today. When the instructor uses this command in Windows CMD with dotnet version 5.0: For the instructor the generated program.cs file contains the following code: using System; namespace HelloWorld
} When I run the same code in VS Code Terminal: The generated program.cs file contains this code: // See https://aka.ms/new-console-template for more information I was expecting to see the same code generated for me as it was for the instructor (see above code). Am I doing anything wrong? I am not sure if it's a template issue (I currently don't know anything about dotnet templates as I've only just started out learning dotnet/C# today!) or if this is the normal expected behaviour of dotnet 6.0.4. Not sure if this is a dotnet issue or something not right on my Windows 11 build. PS. I have added lines to make the code clearer because GitHub is messing up the code. |
@MojoMoe You're running to this: dotnet/docs#27420 .NET SDK 6.0.xxx uses a new Console template using the top-level statements. It's neither Windows 11 nor Visual Studio to blame; it's just the console template. If you have .NET SDK 6.0.300 or higher, would This is explained here: https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-new-sdk-templates#console |
Hi @EoflaOE Thanks very much for your response, it's very helpful. I will try that. Much appreciated :) |
Closing as there is a documented way to get the old template style. |
I checked the documentations listed in this thread, linked sub-pages in regards to implicit usings and did a quick search but was unable to find documentation about it. Mind posting the documentation on how to use the old template style in regards to implicit usings? I can see options to use the old Program with main instead of top level statements but no option to disable implicit usings either via a different template or a template setting. |
However, |
Is your feature request related to a problem? Please describe.
A lot of people dislike .NET 6 templates (dotnet/docs#27420). Some minimum progress was made to bring portions of the old templates back with the following option
Unfortunately the end product is far from what is expected by the community and what was voted for already by more than 1K people.
Describe the solution you'd like
An option to use templates as with .NET 5 without top-level statements and implicit usings. Exactly for what voted more than 1K people.
The text was updated successfully, but these errors were encountered: