Figuring out the project structure
Now it's time to take a look at the different files and how they may differ in different projects. Take a look at the code in the two projects we just created (in the Creating our first Blazor app section) while we go through them.
Program.cs
Program.cs
is the first class that gets called. It also differs between Blazor Server and Blazor WebAssembly.
WebAssembly Program.cs
In the MyBlogWebAssembly.Client
project, there is a file called Program.cs
and it looks like this:
public class Program { public static async Task Main(string[] args) { var builder = WebAssemblyHostBuilder.CreateDefault (args); builder.RootComponents.Add<App>("#app"); builder.Services.AddScoped...