When creating Blazor project with dotnet new blazor
_Imports.razor get created in Components directory. It’s working fine.
I’ve server-side Blazor project “mutated” gradually from .NET Core 3.x to .NET 8 mostly by using upgrade-assistant
command. _Imports.razor is in the root directory of project and it’s also working fine. I want to try to “modernize” this project structure to something resembling dotnet new blazor
template.
I tried moving even just _Imports.razor to Components directory (in Program.cs I’ve added using Project.Components;
) but this operation breaks whole application horribly (a lot of unknown namespaces).
What further puzzles me is that I can move _Imports.razor to root directory in new Blazor project and it’s still working fine. How this is possible? What determines where _Imports.razor can be and where not?