Denny09310.AspNetCore.Blazor.Templates 1.0.5

dotnet new install Denny09310.AspNetCore.Blazor.Templates::1.0.5
                    
This package contains a .NET Template Package you can call from the shell/command line.

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 (.sln or .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: .sln or .slnx
  • โšก Automatically restores NuGet packages after creation
  • ๐Ÿ–ผ๏ธ Custom icon for Visual Studio / dotnet new list 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 restore after 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.

Version Downloads Last Updated
1.0.5 187 3/12/2026
1.0.4 175 3/12/2026
1.0.2 419 11/6/2025
1.0.1 401 11/5/2025
1.0.0 403 10/30/2025