.NET Core 入门Get started with .NET Core

本文提供 .NET Core 入门的相关信息。This article provides information on getting started with .NET Core. 可在 Windows、Linux 和 macOS 上安装 .NET Core。.NET Core can be installed on Windows, Linux, and macOS. 你可在最喜欢的文本编辑器中编写代码并生成跨平台的库和应用程序。You can code in your favorite text editor and produce cross-platform libraries and applications.

如果不确定 .NET Core 是什么或其与其他 .NET 技术的关系,请首先参阅 What is .NET(.NET 是什么)概述。If you're unsure what .NET Core is, or how it relates to other .NET technologies, start with the What is .NET overview. 简单地说,.NET Core 是一个跨平台的开放源代码 .NET 实现。Put simply, .NET Core is an open-source, cross-platform implementation of .NET.

创建应用程序Create an application

首先,在计算机上下载并安装 .NET Core SDKFirst, download and install the .NET Core SDK on your computer.

然后,打开某一终端,如 PowerShell、命令提示符或 Bash。Next, open a terminal such as PowerShell, Command Prompt, or bash. 键入以下 dotnet 命令以创建并运行 C# 应用程序:Type the following dotnet commands to create and run a C# application:

dotnet new console --output sample1
dotnet run --project sample1

您应看到以下输出:You should see the following output:

Hello World!

祝贺你!Congratulations! 现已创建了一个简单的 .NET Core 应用程序。You've created a simple .NET Core application. 还可以使用 Visual Studio CodeVisual Studio(仅限 Windows)或 Visual Studio for Mac(仅限 macOS)来创建 .NET Core 应用程序。You can also use Visual Studio Code, Visual Studio (Windows only), or Visual Studio for Mac (macOS only), to create a .NET Core application.


通过以下分步教程着手开发 .NET Core 应用程序:Get started developing .NET Core applications by following these step-by-step tutorials:

视频摄影机图标movie camera icon for video 观看第 9 频道上的如何安装和使用 Visual Studio Code 和 .NET Core 视频。Watch the how to install and use Visual Studio Code and .NET Core video on Channel 9.
视频摄影机图标movie camera icon for video 观看 YouTube 上的 .NET Core 101 视频。Watch the .NET Core 101 videos on YouTube.

请参阅 .NET Core 依赖项和要求一文,以获取支持的 Windows 版本列表。See the .NET Core dependencies and requirements article for a list of the supported Windows versions.