Dotnet Core 简明教程

.NET Core - SDK

在本章中,我们将了解 .NET Core 中的即将推出的功能。我们将通过在浏览器中打开以下网址来开始使用 .NET 命令行工具 https://github.com/dotnet/cli

In this chapter, we will understand the upcoming features in .NET Core. We will start with the .NET command line tools by opening the following Url in browser https://github.com/dotnet/cli

url

如需了解有关进度的更多信息,您可以向下滚动并下载最新版本的 .NET Core SDK,您将看到安装器和二进制文件部分。

To know more about the progress, you can download the latest version of .NET Core SDK by scrolling down and you will see the Installer and Binaries section.

binaries section

您可以看到针对不同操作系统的最新预览工具版本,让我们根据您的操作系统选择安装器。

You can see the latest version of preview tools for different operating systems, let us select the Installer as per your operating system.

我们正在研究 .NET Core 2.0 的预览 1。

We are working on preview 1 of .NET Core 2.0.

现在,让我们查看我们的当前工具,为此打开命令提示符并执行以下命令。

Let us now look at our current tooling by opening the command prompt and execute the following command.

dotnet --info

您将在您的系统中看到有关当前安装的 .NET 命令行工具版本的如下信息。

You will see information about the currently installed version of .NET Command Line Tools on your system as shown below.

command line tools

您能看到当前我们有 preview2 工具。我们现在运行以下命令,以查看 new 命令。

You can see that currently we have preview 2 tooling. Let us now run the following command to see about the new command.

dotnet help new

对于项目的新的命令语言,您可以选择如 C# 和 F# 以及项目的类型等。

For new command language of project, you can select like C# and F# and the type of project, etc.

project type

我们现在来看一下 .NET Core 最新版本的更改。一旦下载了安装程序,双击以安装它。单击“安装”。

Let us now see the changes in the latest version of .NET Core. Once the installer is downloaded, double-click on it to install it. Click on Install.

installer

以下屏幕截图显示了安装过程。

The following screenshot shows the installation process.

process

它将会开始安装过程。一旦安装完成,关闭此对话。

It will start the installation process. One the installation is finished, Close this dialog.

installation finished

打开命令提示符并执行以下命令。

Open the command prompt and execute the following command.

dotnet --info

您将会看到如下所示您的系统中当前安装的 .NET 命令行工具的版本信息。

You will see information of currently installed version of .NET Command Line Tools on your system as shown below.

tools on system

您现在能看到我们有 .NET Core 2 的 preview1 工具。我们现在在命令提示符中运行以下代码,以了解 .NET Core 2 preview1 中的新命令。

You can now see that we have preview1 tooling of .NET Core 2. Let us now run the following code in the command prompt to see about the new command in .NET Core 2 preview1.

dotnet help new

该命令会帮助您将包以及包缓存下载到中。

The command helps you download packages as well to the package cache.

package cache

该命令打开以下网页,其中包含 .NET Core 2 preview1 中有关新命令的信息。

The command opens the following webpage which contains information about the new command in .NET Core 2 preview1.

preview1

我们向下滚动,您现在可以看到我们可以使用更多的模板创建 .NET Core 应用程序。

Let us scroll down, you can now see that we can create the .NET Core application with more templates.

templates

我们现在可以使用命令行来创建 mstest, web, mvcwebapi 项目。

We can now create mstest, web, mvc and webapi projects as well using the command line.