ASP.NET Core Web SDKASP.NET Core Web SDK

概述Overview

Microsoft.NET.Sdk.Web 是一个用于构建 ASP.NET Core 应用的 MSBuild 项目 SDKMicrosoft.NET.Sdk.Web is an MSBuild project SDK for building ASP.NET Core apps. 无需此 SDK 即可构建 ASP.NET Core 应用,不过该 Web SDK:It's possible to build an ASP.NET Core app without this SDK, however, the Web SDK is:

  • 旨在提供一流的体验。Tailored towards providing a first-class experience.
  • 是大多数用户的理想之选。The recommended target for most users.

在项目中使用该 Web.SDK:Use the Web.SDK in a project:

<Project Sdk="Microsoft.NET.Sdk.Web">
  <!-- omitted for brevity -->
</Project>

通过使用该 Web SDK 启用的功能:Features enabled by using the Web SDK:

  • 面向 .NET Core 3.0 或更高版本的项目隐式引用:Projects targeting .NET Core 3.0 or later implicitly reference:

  • 该 Web SDK 会导入 MSBuild 目标,允许使用发布配置文件并使用 WebDeploy 进行发布。The Web SDK imports MSBuild targets that enable the use of publish profiles and publishing using WebDeploy.

属性Properties

PropertyProperty 描述Description
DisableImplicitFrameworkReferences 禁用对 Microsoft.AspNetCore.App 共享框架的隐式引用。Disables implicit reference to the Microsoft.AspNetCore.App shared framework.
DisableImplicitAspNetCoreAnalyzers 禁用对 ASP.NET Core 分析器的隐式引用。Disables implicit reference to ASP.NET Core analyzers.
DisableImplicitComponentsAnalyzers 在构建 Blazor(服务器)应用程序时禁用对 Razor 组件分析器的隐式引用。Disables implicit reference to Razor Components analyzers when building Blazor (server) applications.