-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Remove legacy console template comment from .NET 10 console template #51527
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
Remove legacy console template comment from .NET 10 console template #51527
Conversation
Co-authored-by: stephentoub <2642209+stephentoub@users.noreply.github.com>
|
Replaces #51527 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR removes the introductory comment "// See https://aka.ms/new-console-template for more information" from console application templates and their associated test approval files. The change simplifies the generated console application code by eliminating an informational comment that pointed to template documentation.
Key changes:
- Removed the documentation comment from the main console template source
- Updated all test approval files to reflect the cleaner generated output
Reviewed Changes
Copilot reviewed 22 out of 22 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| template_feed/Microsoft.DotNet.Common.ProjectTemplates.10.0/content/ConsoleApplication-CSharp/Program.cs | Removed the conditional comment block that displayed template documentation URL for top-level programs |
| test/dotnet-new.IntegrationTests/Approvals/* (multiple files) | Updated test approval files to match the new template output without the documentation comment |
| test/TestAssets/TestProjects/* (multiple files) | Updated test asset files to align with the new template format |
|
@copilot the |
…template packages Co-authored-by: stephentoub <2642209+stephentoub@users.noreply.github.com>
Head branch was pushed to by a user without write access
... Fixed in commit 849c41b. The issue was that tests with explicit framework targets (net6.0, net7.0, net8.0) use external NuGet packages that still contain the comment. I reverted the baseline changes for those framework-specific tests while keeping the changes for .NET 10 (current) baselines and the template source. The FeaturesSupport tests install template packages from NuGet for older frameworks, so those tests need baselines that match the released templates (with comment). Only tests without explicit framework specifications use the .NET 10 template (without comment).
Addressed in commit 849c41b. Root cause: The FeaturesSupport tests install external NuGet packages for .NET 6/7/8/9 templates from Solution: Reverted baseline changes for framework-specific tests (net6/7/8) so they expect the comment from the external packages. Kept changes for .NET 10 template and baselines without framework specifications. Verified: .NET 10 console apps now generate without the comment: |
|
/ba-g known issue |
|
/backport to release/10.0.2xx |
|
Started backporting to |
The console template includes a legacy comment
// See https://aka.ms/new-console-template for more informationthat should be removed, resulting in cleaner template output with just theConsole.WriteLinestatement.Changes
ConsoleApplication-CSharp/Program.cs(.NET 10 template)Result
Note
The
FeaturesSupporttests install external template packages from NuGet for .NET 6, 7, 8, and 9. These released packages still contain the comment. Only the .NET 10 template (current development version) has been updated to remove the comment. Tests with explicit--framework net6.0/7.0/8.0continue to use and expect the comment from those external packages.Fixes the issue from previous PR #42497 by correctly targeting only .NET 10 baselines.
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.