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 从公开仓库中收录这些内容。

举报或申请下架