Blazor WASM + Hosted ASP.NET coupling

Rish 1 Reputation point
2022-05-03T15:27:25.543+00:00

Hi

I am planning to deploy the latest version of Blazor WASM + Hosted ASP.NET core project type to Azure in production.
It publishes fine and works as expected.

However, before deploying, I really want to understand how they are coupled together so that it publishes both the Server and Client projects correctly?
Where is this magic happening?
Unable to find it in the documentation.

Please guide on where to look.

Thank you

Blazor
Blazor
A free and open-source web framework that enables developers to create web apps using C# and HTML being developed by Microsoft.
1,497 questions
ASP.NET
ASP.NET
A set of technologies in the .NET Framework for building web applications and XML web services.
3,414 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. AgaveJoe 27,656 Reputation points
    2022-05-03T18:54:09.383+00:00

    The client project is a Class Library DLL in the Server project. The fallback is index.html which is the file that bootstraps the Blazor application. Deploy the server app and take a look at the wwwroot folder.

    0 comments No comments

  2. Zhi Lv - MSFT 32,106 Reputation points Microsoft Vendor
    2022-05-04T05:48:31.68+00:00

    Hi @Rish ,

    An asp.net core hosted Blazor Webassembly application (for example named MultipleBlazorApps) contain the following projects:

    MultipleBlazorApps.Client is a Blazor WebAssembly client app in the Client folder.
    MultipleBlazorApps.Server is an ASP.NET Core server app that serves Blazor WebAssembly apps) in the Server folder. Optionally, the server app can also serve pages or views, as a traditional Razor Pages or MVC app.
    MultipleBlazorApps.Shared is a shared resources project for the client and server projects in the Shared folder.

    If you check the project reference, you can see that the Client and Server project will add the Shared project reference. And the Server project also depends on the Client and Shared project. So, when publish the application, you should publish the Server project.

    More detail infromation, see Hosted deployment with multiple Blazor WebAssembly apps.


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    Best regards,
    Dillion

    0 comments No comments