roslyn: Wrong IDE0130 message "Namespace 'Foo' does not match folder structure, expected 'Foo'"
This issue has been moved from a ticket on Developer Community.
[regression] [worked-in:16.11?] I have a .NET 5.0 project which has app which has default namespace ‘Microsoft.BigSolutionGenerator’. Each source file shows
IDE0130: "Namespace "Microsoft.BigSolutionGenerator" does not match folder structure, expected "Microsoft.BigSolutionGenerator."
… although it already has namespace Microsoft.BigSolutionGenerator. Lightbulb offers to replace namespace with Microsoft.BigSolutionGenerator.Microsoft.BigSolutionGenerator
Original Comments
Feedback Bot on 7/20/2021, 11:41 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 7/21/2021, 10:09 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)
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 6
- Comments: 18 (6 by maintainers)
I’m also having this issue with a .NET 6 project. In Visual Studio the code fix works fine, but when triggered from dotnet format I do get the aforementioned exception. Example solution can be found here.
Exception that occurs when running
dotnet format
on the solution:I still have the issue in 5.0.402, so it is not fixed. @edwiles I did a global suppression just for the root namespace, which solved it for the time being.
I can confirm that image 5.0.303 works
We face the same issue in our .NET 5 project as well using the mcr.microsoft.com/dotnet/sdk:5.0 base image to build in docker.
Related to the second note in https://github.com/dotnet/roslyn/issues/54757.