Denny09310.AspNetCore.Blazor.Templates
1.0.5
dotnet new install Denny09310.AspNetCore.Blazor.Templates::1.0.5
Blazor WebAssembly Hosted Template
A custom multi-project template for quickly creating a solution that combines:
- Blazor WebAssembly (standalone) client app (
Client) - ASP.NET Core Web API backend (
Server) - A shared solution file (
.slnor.slnx) - Configurable .NET version (8, 9, or 10 preview)
๐งฐ Features
- ๐ง Ready-to-run hosted Blazor WebAssembly + Web API setup
- ๐ฏ Choose your target framework:
.NET 8,.NET 9, or.NET 10 - ๐งฉ Choose solution format:
.slnor.slnx - โก Automatically restores NuGet packages after creation
- ๐ผ๏ธ Custom icon for Visual Studio /
dotnet newlist view
๐ How to Install
Option 1 โ From Local Folder
If you cloned or downloaded this repo:
dotnet new --install ./MyBlazorHostedTemplate
Option 2 โ From NuGet Package (after publishing)
dotnet new --install Denny09310.AspNetCore.Blazor.Templates::<version>
Replace <version> with the NuGet version (e.g. 1.0.0).
๐งฉ Create a New Project
Run one of the following commands:
# Default (uses .NET 9 and classic .sln)
dotnet new blazor-hosted -n MyApp
# Use .NET 8 (LTS)
dotnet new blazor-hosted -n MyApp -p framework=net8.0
# Use .NET 10 (preview)
dotnet new blazor-hosted -n MyApp -p framework=net10.0
# Use accelerated .slnx format
dotnet new blazor-hosted -n MyApp -p format=slnx
๐๏ธ Generated Structure
After creation, youโll get a solution like this:
MyApp/
โโโ MyApp.sln (or MyApp.slnx)
โโโ Client/
โ โโโ Client.csproj
โ โโโ (Blazor WebAssembly app)
โโโ Server/
โโโ Server.csproj
โโโ (ASP.NET Core Web API)
โ๏ธ Template Parameters
| Parameter | Alias | Description | Default |
|---|---|---|---|
framework |
-p framework= |
Target framework (net8.0, net9.0, net10.0) |
net9.0 |
format |
-p format= |
Solution type (sln or slnx) |
sln |
๐ก Development Notes
- The icon is located in
.template.config/images/icon.png - Template configuration:
.template.config/template.json - CLI display configuration:
.template.config/dotnetcli.host.json - Automatically runs
dotnet restoreafter creation
๐งช Testing Locally
Uninstall / reinstall after making changes:
dotnet new --uninstall ./MyBlazorHostedTemplate
dotnet new --install ./MyBlazorHostedTemplate
List your installed templates:
dotnet new list
๐ฆ Packaging for Distribution
Option 1 โ Pack from .nuspec
nuget pack BlazorHostedTemplate.nuspec
dotnet new --install ./Denny09310.AspNetCore.Blazor.Templates.1.0.0.nupkg
Option 2 โ Pack via SDK Project
dotnet pack ./TemplatePack/TemplatePack.csproj -c Release
dotnet new --install ./bin/Release/Denny09310.AspNetCore.Blazor.Templates.1.0.0.nupkg
๐งโ๐ป Author
Denny09310
๐ง k.denny2000@gmail.com
๐๏ธ Version: 1.0.0
๐ท๏ธ Identity: dev.denny09310.blazor-hosted
๐ License
MIT License โ feel free to use and modify for your own templates.
This package has no dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.