简体   繁体   中英

Check if Blazor app is WebAssembly or Server?

Started a project via cmd so not sure if it is a WebAssembly App och Server side app.

Anybody know how to check this in an easy way in Visual Studio/cmd?

You can open the .csproj file and look at the first line. Blazor Server App project is using Sdk="Microsoft.NET.Sdk.Web" but Blazor WebAssembly App is using Sdk="Microsoft.NET.Sdk.BlazorWebAssembly".

There are several points in the project you can easily check.

Look for the line services.AddServerSideBlazor(); in ConfigureServices()

If three projects (.Client, .Server, .Shared) were created, this is a WebAssembly Blazor App hosted (on the server).

If a single project was created, it might be a WebAssembly Blazor stand alone App, or a Blazor Server App. In that case you should look for the Startup class. If exists, that means that your project is a Blazor Server App, if not then it is a WebAssembly Blazor stand alone. This is basically how I often view the structure of my solution, by a quick scan.

您可以通过在 localhost 中运行应用程序来检查它,然后在应用程序启动时检查网络流量中的启动器。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM