dotnet / roslyn

The Roslyn .NET compiler provides C# and Visual Basic languages with rich code analysis APIs.
https://docs.microsoft.com/dotnet/csharp/roslyn-sdk/
MIT License
18.92k stars 4.02k forks source link

Sync namespaces doesn't update form namespaces in WinForms project #70123

Open vsfeedback opened 11 months ago

vsfeedback commented 11 months ago

This issue has been moved from a ticket on Developer Community.


In the latest versions of VS 2022 "Sync Namespaces" dont work. If i have a file with a namespace that dont match the folder structure, I expect "Sync Namespaces" to rename my namespace. But it always report "No namespaces needed updating."


Original Comments

Alison Jin [MSFT] on 9/24/2023, 07:52 PM:

(private comment, text removed)

Björn Holmgren on 9/25/2023, 01:23 AM:

(private comment, text removed)

Feedback Bot on 9/25/2023, 01:34 AM:

(private comment, text removed)


Original Solutions

(no solutions)

TobiasKoller commented 7 months ago

I've the same problem. Copied a folder with some cs-files to a new project, run Sync namespaces and it tells me that no namespace has to be fixed.

BillyMartin1964 commented 6 months ago

Yes. I have this issue with one whole Maui Project, while other projects in the same solution work fine.

kumarchhajed commented 6 months ago

Doesn't work for Class Library Project as well. VS 2022 17.9.3

Center-Deal commented 4 months ago

Same problem here. 407 namespace errors, and I get "No namespaces needed updating"

XtremeOwnageDotCom commented 1 month ago

Also- to add to this- if you just remove the namespace from a file- it doesn't fix that either.

I had a smart idea of replace ^namespace .* $ with "", and then let the namespace fixer fix it. Nope. Doesn't handle that either.