if I have a structure like this
.
├── NamespaceIssues.BlazorApp
│ └── Shared/
│ └── SomeIrrelevantClass.cs
└── NamespaceIssues.Shared/
| └── Contract/
| └── SomeClass
and have a component that takes a list of SomeClass as an argument
We end up with multiple compile errors because the compiler appears to be searching the wrong place for the code (searching the Blazor project rather than the shared project).
Error CS0234 : The type or namespace name 'SomeClass' does not exist in the namespace 'NamespaceIssues.Shared'Argument 1: cannot convert from 'System.Collections.Generic.List<Shared.SomeClass>' to 'System.Collections.Generic.List<NamespaceIssues.Shared.SomeClass>'
It can be fixed by changing the folder NamespaceIssues.Shared to a different name but this feels like a workaround rather than a solution.
I expect that it should find the correct file in the correct namespace even if I have a subfolder in the Blazor project named the same as a class library project.
Is there an existing issue for this?
Describe the bug
if I have a structure like this . ├── NamespaceIssues.BlazorApp │ └── Shared/ │ └── SomeIrrelevantClass.cs └── NamespaceIssues.Shared/ | └── Contract/ | └── SomeClass
and have a component that takes a list of
SomeClass
as an argumentComponent:
Which is called by:
Calling Component:
We end up with multiple compile errors because the compiler appears to be searching the wrong place for the code (searching the Blazor project rather than the shared project).
Error CS0234 : The type or namespace name 'SomeClass' does not exist in the namespace 'NamespaceIssues.Shared'
Argument 1: cannot convert from 'System.Collections.Generic.List<Shared.SomeClass>' to 'System.Collections.Generic.List<NamespaceIssues.Shared.SomeClass>'
It can be fixed by changing the folder
NamespaceIssues.Shared
to a different name but this feels like a workaround rather than a solution.I've added a full reproduction here: Reproduction
Expected Behavior
I expect that it should find the correct file in the correct namespace even if I have a subfolder in the Blazor project named the same as a class library project.
Steps To Reproduce
I've added a full reproduction here: Reproduction
Exceptions (if any)
No response
.NET Version
8.0.303
Anything else?
No response