Blazor United in .NET 8 creates two projects,
- "BlazorApp1" project
- "BlazorApp1.Client" project.
I understood that, "BlazorApp1" is designated for Static Server and WebSocket pages, I cannot or I should not use @rendermode InteractiveWebAssembly or @rendermode InteractiveAuto in the "BlazorApp1" project.
Then, I assumed that, in the "BlazorApp1.Client" project, I should or I can use pages with attribute only @rendermode InteractiveWebAssembly. But, surprisingly I see that, I can use @rendermode InteractiveServer in a page in the "BlazorApp1.Client". And it works without any error. In fact, I can use regular Statis Server pages in that "BlazorApp1.Client" project.
This discovery leads me to question the necessity of distributing pages between two projects.
If "BlazorApp1.Client" supports all render modes specially InteractiveServer, is there a compelling reason not to consolidate all pages there for organizational simplicity?
I really hate the idea to distribute my pages between two projects, and I discovered that, I do not need to distribute my pages between two projects, I can rather have all of pages into the "BlazorApp1.Client" project where I can have different render modes including InteractiveServer. Then why should I bother hosting some InteractiveServer pages into the BlazorApp1 page? What is the catch here?