convert-blazor-server-to-webapp

A migration guide for converting an older Blazor Server application into the .NET 8 or newer Blazor Web App model. Blazor is a .NET framework for building interactive web interfaces with C#.

In plain words
What is it for?
Use it when replacing AddServerSideBlazor and MapBlazorHub, converting the host page to App.razor, changing the JavaScript file, and adopting the newer component model.
Why use it?
It helps update the hosting and rendering setup while preserving interactive server rendering and avoiding obsolete files and methods.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/managedcode/dotnet-skills/convert-blazor-server-to-webapp
Any agent
npx skills add managedcode/dotnet-skills --skill convert-blazor-server-to-webapp
Clone the repo
git clone --depth 1 https://github.com/managedcode/dotnet-skills

Made for: Claude Code, Codex.

Per session 176 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,699 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin 100% copy Near-identical to another mod in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00176 $0.03699
Opus 5 $0.00088 $0.01850
Sonnet 5 $0.00035 $0.00740
Haiku 4.5 $0.00018 $0.00370

Measured 3d ago against content hash 679607e47f22, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

convert-blazor-server-to-webapp scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

This is a copy

100% identical to convert-blazor-server-to-webapp — 0 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

catalog/Frameworks/Official-DotNet-ASPNetCore/skills/convert-blazor-server-to-webapp/SKILL.md · 296 lines

How it starts

The opening of the file, as written. The whole thing — 296 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Convert Blazor Server App to Blazor Web App

This skill helps an agent convert a pre-.NET 8 Blazor Server app into a .NET 8+ Blazor Web App. The old hosting model uses AddServerSideBlazor/MapBlazorHub with a _Host.cshtml Razor Page as the entry point. The new Blazor Web App model uses AddRazorComponents/MapRazorComponents with an App.razor root component, enabling per-component render modes, enhanced navigation, streaming rendering, and other .NET 8+ features. The converted app uses InteractiveServer render mode to preserve existing interactive behavior.

When to Use

  • Migrating a Blazor Server app from .NET 6 or .NET 7 to .NET 8+
  • App currently uses AddServerSideBlazor() and MapBlazorHub() in Program.cs (or Startup.cs)
  • App uses Pages/_Host.cshtml (or _Host.razor) as the host page with Component Tag Helpers
  • Want to adopt new Blazor Web App features while keeping interactive server rendering

When Not to Use

  • The app already uses AddRazorComponents and MapRazorComponents. It is already a Blazor Web App — no conversion is needed. Stop here and tell the user the app is already using the Blazor Web App model.
  • Blazor WebAssembly or hosted Blazor WebAssembly app — these have a different migration path
  • The app should stay on the legacy Blazor Server hosting model (just update TFM and packages)
  • The app targets .NET Framework — it must be migrated to .NET first

Inputs

Input Required Description
Blazor Server project Yes The .csproj and source files of the Blazor Server app
Target framework Yes .NET 8 or later (e.g., net8.0, net9.0, net10.0)
Program.cs or Startup.cs Yes The app's service and middleware configuration
_Host.cshtml location Recommended Usually Pages/_Host.cshtml; may be _Host.razor in some projects

Workflow

Commit strategy: Commit after each logical step so the migration is reviewable and bisectable.

Read the full file on GitHub · 296 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago First seen · 296 lines · 176 tokens per session scan A 679607e47f22

Subscribe to this mod's changes

convert-blazor-server-to-webapp is a skill published in the GitHub repository managedcode/dotnet-skills (477 stars, last pushed 3d ago), licensed MIT. It adds 176 tokens to every session and 3,699 once invoked, about $0.0009 per session on Opus 5. A static security scan graded it A with 0 findings. It is 100% identical to convert-blazor-server-to-webapp, differing in 0 lines, and is treated as a copy.

Related

Other skills, from other repositories

clean-architecture-dotnet

Use when domain logic leaks into API/Infrastructure, project references violate layer boundaries, or you need to decide between CQS (always), CQRS bus (complex domains), and DDD patterns (invariants and events).

SebastienDegodez/copilot-instructions · 50 tokens

creating-dotnet-mcp-servers

Use when building Model Context Protocol (MCP) servers in .NET, configuring tools, transports (SSE/stdio), JSON serialization for AOT, or testing MCP endpoints.

SebastienDegodez/copilot-instructions · 43 tokens

release

Prepare and publish Perigon.CLI patch releases, including versioning, release notes, bilingual docs, validation, and the nuget-branch CI handoff.

AterDev/Perigon.CLI · 34 tokens

blazor

Use for Blazor Server development with Fluent UI Blazor, Razor components, layouts, pages, scoped UI services, culture switching, localization, forms, loading/empty/error states, and Studio-style dashboard workflows.

AterDev/Perigon.CLI · 45 tokens

cli

Use for .NET command-line tool development with Spectre.Console/Spectre.Console.Cli, Microsoft.Extensions.Hosting, dependency injection, localized help text, command settings, aliases, examples, terminal output, exit codes, and stdio-safe command paths.

AterDev/Perigon.CLI · 52 tokens

codegen

Use for .NET code generation work with Roslyn, Microsoft.OpenApi, Razor templates, DTO/manager/controller generation, REST API generation, C# HttpClient generation, Angular/Axios TypeScript request clients, generated formatting, and deterministic output.

AterDev/Perigon.CLI · 53 tokens