You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you create a new project in a solution that uses file-scoped namespaces the classes created by the project template should also use file-scoped namespaces.
Similar to dotnet/templating#3930, which only handled new item templates (which work fine).
Repro steps:
Create a new repository/solution with an EditorConfig file. Make sure the EditorConfig file contains csharp_style_namespace_declarations = file_scoped:suggestion.
Create a new project targeting . NET6 that contains at least one class with a namespace (e.g. class library or WPF application).
See that the namespace in the generated class file uses the old block scoped style and that IDE0161 "Convert to file-scoped namespace" is triggered immediately.
Tested with Visual Studio 2022 17.0.6 and Version 17.2.0 Preview 1.0 [32130.36.main]
Original Comments
Feedback Bot on 23/02/2022, 01:00 PM:
We have directed your feedback to the appropriate engineering team for further evaluation. The team will review the feedback and notify you about the next steps.
davidwengier
changed the title
Use file-scoped namespace for classes in project templates
New document formatting service doesn't consider .editorconfig files
Mar 29, 2022
This issue has been moved from a ticket on Developer Community.
Originally created in dotnet/templating#4394
If you create a new project in a solution that uses file-scoped namespaces the classes created by the project template should also use file-scoped namespaces.
Similar to dotnet/templating#3930, which only handled new item templates (which work fine).
Repro steps:
Tested with Visual Studio 2022 17.0.6 and Version 17.2.0 Preview 1.0 [32130.36.main]
Original Comments
Feedback Bot on 23/02/2022, 01:00 PM:
We have directed your feedback to the appropriate engineering team for further evaluation. The team will review the feedback and notify you about the next steps.
Feedback Bot on 24/02/2022, 10:34 AM:
Thank you for sharing your feedback! Our teams prioritize action on product issues with broad customer impact. See details at: https://docs.microsoft.com/en-us/visualstudio/ide/report-a-problem?view=vs-2019#faq. In case you need answers to common questions or need assisted support, be sure to use https://visualstudio.microsoft.com/vs/support/. We’ll keep you posted on any updates to this feedback.
Original Solutions
(no solutions)
The text was updated successfully, but these errors were encountered: