Creates a new .NET 10 solution with proper project structure, NuGet packages, and configuration
From dotnet-blazornpx claudepluginhub markus41/claude --plugin dotnet-blazor/blazor-new [project-type] [project-name] [--render-mode server|wasm|auto] [--auth identity|entra|jwt|none] [--db sqlserver|postgres|sqlite|cosmos] [--ui syncfusion|fluentui|mudblazor|none] [--aspire] [--docker] [--tests]
| Type | Description | Template |
|---|---|---|
webapp (default) | Blazor Web App with SSR + interactivity | blazor |
api | ASP.NET Core Web API (minimal APIs) | webapi |
fullstack | Blazor Web App + separate API project | blazor + webapi |
microservice | Aspire-orchestrated multi-service solution | aspire-starter |
grpc | gRPC service | grpc |
# Create solution
dotnet new sln -n {ProjectName}
# For webapp
dotnet new blazor -n {ProjectName}.Web --interactivity {RenderMode} --auth {AuthType} -f net10.0
# For fullstack (adds API project)
dotnet new webapi -n {ProjectName}.Api --use-minimal-apis -f net10.0
# For microservice (Aspire)
dotnet new aspire-starter -n {ProjectName} -f net10.0
# Shared class library
dotnet new classlib -n {ProjectName}.Shared -f net10.0
# Add projects to solution
dotnet sln add {ProjectName}.Web/{ProjectName}.Web.csproj
{ProjectName}/
├── {ProjectName}.sln
├── Directory.Build.props # Shared MSBuild properties
├── Directory.Packages.props # Central package management
├── .editorconfig # Code style rules
├── global.json # SDK version pinning
├── {ProjectName}.Web/
│ ├── Program.cs # App host and DI setup
│ ├── Components/
│ │ ├── App.razor # Root component
│ │ ├── Routes.razor # Router
│ │ ├── Layout/
│ │ │ ├── MainLayout.razor
│ │ │ └── NavMenu.razor
│ │ └── Pages/
│ │ ├── Home.razor
│ │ └── Error.razor
│ ├── Services/ # Business logic services
│ ├── Models/ # View models and DTOs
│ └── wwwroot/ # Static assets
├── {ProjectName}.Api/ # (fullstack/microservice)
│ ├── Program.cs
│ ├── Endpoints/ # Minimal API endpoint groups
│ ├── Services/
│ └── Middleware/
├── {ProjectName}.Shared/
│ ├── Models/ # Shared domain models
│ ├── DTOs/ # Data transfer objects
│ └── Contracts/ # Service interfaces
├── {ProjectName}.Data/ # (if --db specified)
│ ├── AppDbContext.cs
│ ├── Entities/
│ ├── Configurations/ # EF Core fluent config
│ └── Migrations/
├── {ProjectName}.Tests/ # (if --tests specified)
│ ├── Unit/
│ ├── Integration/
│ └── E2E/
└── {ProjectName}.AppHost/ # (if --aspire specified)
└── Program.cs # Aspire orchestration
Program.cs (Blazor Web App):
var builder = WebApplication.CreateBuilder(args);
// Add services
builder.Services.AddRazorComponents()
.AddInteractiveServerComponents() // For Server mode
.AddInteractiveWebAssemblyComponents(); // For WASM mode
// Add Syncfusion (if --ui syncfusion)
builder.Services.AddSyncfusionBlazor();
// Add EF Core (if --db specified)
builder.Services.AddDbContext<AppDbContext>(options =>
options.UseSqlServer(builder.Configuration.GetConnectionString("Default")));
// Add authentication (if --auth specified)
builder.Services.AddAuthentication().AddMicrosoftIdentityWebApp(builder.Configuration);
var app = builder.Build();
app.UseStaticFiles();
app.UseAntiforgery();
app.MapRazorComponents<App>()
.AddInteractiveServerRenderMode()
.AddInteractiveWebAssemblyRenderMode();
app.Run();
Directory.Build.props:
<Project>
<PropertyGroup>
<TargetFramework>net10.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
</Project>
global.json:
{
"sdk": {
"version": "10.0.100",
"rollForward": "latestFeature"
}
}
Install based on flags:
| Flag | Packages |
|---|---|
--ui syncfusion | Syncfusion.Blazor.Themes, Syncfusion.Blazor.Core, relevant component packages |
--ui fluentui | Microsoft.FluentUI.AspNetCore.Components |
--ui mudblazor | MudBlazor |
--db sqlserver | Microsoft.EntityFrameworkCore.SqlServer, Microsoft.EntityFrameworkCore.Tools |
--db postgres | Npgsql.EntityFrameworkCore.PostgreSQL |
--auth identity | Microsoft.AspNetCore.Identity.EntityFrameworkCore |
--auth entra | Microsoft.Identity.Web, Microsoft.Identity.Web.UI |
--aspire | Aspire.Hosting, Aspire.Dashboard |
--tests | xunit, bunit, Microsoft.AspNetCore.Mvc.Testing, FluentAssertions |
--docker | Generate Dockerfile and docker-compose.yml |
dotnet restore
dotnet build --no-restore
# If tests: dotnet test --no-build
Provide: