ASP.NET Core 简介Introduction to ASP.NET Core

作者:Daniel RothRick AndersonShaun LuttinBy Daniel Roth, Rick Anderson, and Shaun Luttin

ASP.NET Core 是一个跨平台的高性能开源框架,用于生成基于云且连接 Internet 的新式应用程序。ASP.NET Core is a cross-platform, high-performance, open-source framework for building modern, cloud-based, Internet-connected applications. 使用 ASP.NET Core,您可以:With ASP.NET Core, you can:

  • 建置 Web 应用程序和服务、IoT 应用和移动后端。Build web apps and services, IoT apps, and mobile backends.
  • 在 Windows、macOS 和 Linux 上使用喜爱的开发工具。Use your favorite development tools on Windows, macOS, and Linux.
  • 部署到云或本地。Deploy to the cloud or on-premises.
  • .NET Core 或 .NET Framework 上运行。Run on .NET Core or .NET Framework.

为何使用 ASP.NET Core?Why use ASP.NET Core?

数百万开发人员使用过(并将继续使用)ASP.NET 4.x 创建 Web 应用。Millions of developers have used (and continue to use) ASP.NET 4.x to create web apps. ASP.NET Core 是重新设计的 ASP.NET 4.x,更改了体系结构,形成了更精简的模块化框架。ASP.NET Core is a redesign of ASP.NET 4.x, with architectural changes that result in a leaner, more modular framework.

ASP.NET Core 具有如下优点:ASP.NET Core provides the following benefits:

使用 ASP.NET Core MVC 生成 Web API 和 Web UIBuild web APIs and web UI using ASP.NET Core MVC

ASP.NET Core MVC 提供生成 Web APIWeb 应用所需的功能:ASP.NET Core MVC provides features to build web APIs and web apps:

客户端开发Client-side development

ASP.NET Core 与常用客户端框架和库(包括 AngularReactBootstrap)无缝集成。ASP.NET Core integrates seamlessly with popular client-side frameworks and libraries, including Angular, React, and Bootstrap. 有关详细信息,请参阅客户端开发For more information, see Client-side development.

面向 .NET Framework 的 ASP.NET CoreASP.NET Core targeting .NET Framework

ASP.NET Core 可以面向 .NET Core 或 .NET Framework。ASP.NET Core can target .NET Core or .NET Framework. 面向 .NET Framework 的 ASP.NET Core 应用无法跨平台,它们仅在 Windows 上运行。ASP.NET Core apps targeting .NET Framework aren't cross-platform—they run on Windows only. 没有计划删除 ASP.NET Core 中对面向 .NET Framework 的支持。There are no plans to remove support for targeting .NET Framework in ASP.NET Core. 通常,ASP.NET Core 由 .NET Standard 库组成。Generally, ASP.NET Core is made up of .NET Standard libraries. 使用 .NET Standard 2.0 编写的应用可在 NET Standard 2.0 支持的任何位置运行。Apps written with .NET Standard 2.0 run anywhere that .NET Standard 2.0 is supported.

面向 .NET Core 有以下几个优势,并且这些优势会随着每次发布增加。There are several advantages to targeting .NET Core, and these advantages increase with each release. 与 .NET Framework 相比,.NET Core 的部分优势包括:Some advantages of .NET Core over .NET Framework include:

  • 跨平台。Cross-platform. 在 macOS、Linux 和 Windows 上运行。Runs on macOS, Linux, and Windows.
  • 提高的性能Improved performance
  • 并行版本控制Side-by-side versioning
  • 新 APINew APIs
  • 开源Open source

我们正努力缩小 .NET Framework 与 .NET Core 的 API 差距。We're working hard to close the API gap from .NET Framework to .NET Core. Windows 兼容性包使数千个仅 Windows API 可在 .NET Core 中使用。The Windows Compatibility Pack made thousands of Windows-only APIs available in .NET Core. 这些 API 在 .NET Core 1.x 中不可用。These APIs weren't available in .NET Core 1.x.

后续步骤Next steps

有关更多信息,请参见以下资源:For more information, see the following resources: