Aspnet Core

作者 openai49f948faa925無授權條款收錄於 2026年10月8日更新於 2026年10月8日

Build, review, refactor, or architect ASP.NET Core web applications using current official guidance for .NET web development. Use when working on Blazor Web Apps, Razor Pages, MVC, Minimal APIs, controller-based Web APIs, SignalR, gRPC, middleware, dependency injection, configuration, authentication, authorization, testing, performance, deployment, or ASP.NET Core upgrades.

精選僅含說明Software Development
AI 產生的概覽

依據官方 .NET 指引,指導 ASP.NET Core Web 應用程式的建置、審查、重構與架構設計。

功能
此技能為 ASP.NET Core 開發提供結構化指引,涵蓋應用程式模型選擇、主機與要求管線組合,以及功能實作。它會將代理導向針對 Blazor、Razor Pages、MVC、Minimal API、控制器、資料與服務、安全性、即時通訊、測試和版本升級的專題參考文件。它產出架構建議與程式碼指引,而非可執行的成品。
適用情境
適用於處理 ASP.NET Core Web 應用程式時,包括新專案、重大重構、審查或移轉。適合涉及中介軟體、相依性注入、組態、驗證、API、SignalR、gRPC、測試、效能或架構升級的工作。
執行需求
無需指令碼或執行階段相依性;這是僅含說明的技能,依賴隨附的參考文件。代理需要存取此技能的參考檔案,並在驗證最新功能時存取 Microsoft Learn 或 ASP.NET Core 文件存放庫的網路。

ASP.NET Core

Overview

Choose the right ASP.NET Core application model, compose the host and request pipeline correctly, and implement features in the framework style Microsoft documents today.

Load the smallest set of references that fits the task. Do not load every reference by default.

Workflow

  1. Confirm the target framework, SDK, and current app model.
  2. Open references/stack-selection.md [blocked] first for new apps or major refactors.
  3. Open references/program-and-pipeline.md [blocked] next for Program.cs, DI, configuration, middleware, routing, logging, and static assets.
  4. Open exactly one primary app-model reference:
    • references/ui-blazor.md [blocked]
    • references/ui-razor-pages.md [blocked]
    • references/ui-mvc.md [blocked]
    • references/apis-minimal-and-controllers.md [blocked]
  5. Add cross-cutting references only as needed:
    • references/data-state-and-services.md [blocked]
    • references/security-and-identity.md [blocked]
    • references/realtime-grpc-and-background-work.md [blocked]
    • references/testing-performance-and-operations.md [blocked]
  6. Open references/versioning-and-upgrades.md [blocked] before introducing new platform APIs into an older solution or when migrating between major versions.
  7. Use references/source-map.md [blocked] when you need the Microsoft Learn section that corresponds to a task not already covered by the focused references.

Default Operating Assumptions

  • Prefer the latest stable ASP.NET Core and .NET unless the repository or user request pins an older target.
  • As of March 2026, prefer .NET 10 / ASP.NET Core 10 for new production work. Treat ASP.NET Core 11 as preview unless the user explicitly asks for preview features.
  • Prefer WebApplicationBuilder and WebApplication. Avoid older Startup and WebHost patterns unless the codebase already uses them or the task is migration.
  • Prefer built-in DI, options/configuration, logging, ProblemDetails, OpenAPI, health checks, rate limiting, output caching, and Identity before adding third-party infrastructure.
  • Keep feature slices cohesive so the page, component, endpoint, controller, validation, service, data access, and tests are easy to trace.
  • Respect the existing app model. Do not rewrite Razor Pages to MVC or controllers to Minimal APIs without a clear reason.

Reference Guide

  • references/_sections.md [blocked]: Quick index and reading order.
  • references/stack-selection.md [blocked]: Choose the right ASP.NET Core application model and template.
  • references/program-and-pipeline.md [blocked]: Structure Program.cs, services, middleware, routing, configuration, logging, and static assets.
  • references/ui-blazor.md [blocked]: Build Blazor Web Apps, choose render modes, and use components, forms, and JS interop correctly.
  • references/ui-razor-pages.md [blocked]: Build page-focused server-rendered apps with handlers, model binding, and conventions.
  • references/ui-mvc.md [blocked]: Build controller/view applications with clear separation of concerns.
  • references/apis-minimal-and-controllers.md [blocked]: Build HTTP APIs with Minimal APIs or controllers, including validation and response patterns.
  • references/data-state-and-services.md [blocked]: Use EF Core, DbContext, options, IHttpClientFactory, session, temp data, and app state responsibly.
  • references/security-and-identity.md [blocked]: Apply authentication, authorization, Identity, secrets, data protection, CORS, CSRF, and HTTPS guidance.
  • references/realtime-grpc-and-background-work.md [blocked]: Use SignalR, gRPC, and hosted services.
  • references/testing-performance-and-operations.md [blocked]: Add integration tests, browser tests, caching, compression, health checks, rate limits, and deployment concerns.
  • references/versioning-and-upgrades.md [blocked]: Handle target frameworks, breaking changes, obsolete APIs, and migrations.
  • references/source-map.md [blocked]: Map the official ASP.NET Core documentation tree to the references in this skill.

Execution Notes

  • When generating new code, start from the correct dotnet new template and keep the generated structure recognizable.
  • When editing an existing solution, follow the solution's conventions first and use these references to avoid framework misuse or outdated patterns.
  • When a task mentions "latest", verify the feature on Microsoft Learn or the ASP.NET Core docs repo before relying on memory.

來源與署名

來源:openai/skills位於skills/.curated/aspnet-core提交49f948f

授權條款: 無授權條款

內容歸原作者所有。SourceWeft 從公開儲存庫中收錄這些內容。

檢舉或申請下架