.NET Core SDK 概觀.NET Core SDK overview

.NET Core SDK 是可讓開發人員建立 .NET Core 應用程式與程式庫的一組程式庫與工具。The .NET Core SDK is a set of libraries and tools that allow developers to create .NET Core applications and libraries. 其中包含用來建置並執行應用程式的下列元件:It contains the following components that are used to build and run applications:

  • .NET Core CLI。The .NET Core CLI.
  • .NET core 程式庫和執行階段。.NET Core libraries and runtime.
  • dotnet驅動程式The dotnet driver.

取得 .NET Core SDKAcquiring the .NET Core SDK

使用任何工具時,第一件事都是要取得適合電腦的工具。As with any tooling, the first thing is to get the tools to your machine. 視您的案例而定,您可以使用下列方法之一安裝 SDK:Depending on your scenario, you can install the SDK using one of the following methods:

  • 使用原生的安裝程式。Use the native installers.
  • 使用安裝 Shell 指令碼。Use the installation shell script.

原生安裝程式主要是為了開發人員電腦而設計。The native installers are primarily meant for developer's machines. SDK 是使用每個支援平台的原生安裝機制所散發,例如 Ubuntu 的 DEB 套件或 Windows 的 MSI 套件組合。The SDK is distributed using each supported platform's native install mechanism, such as DEB packages on Ubuntu or MSI bundles on Windows. 這些安裝程式會視需要安裝並設定環境,以讓使用者在安裝後可立即使用 SDK。These installers install and set up the environment as needed for the user to use the SDK immediately after the install. 不過,它們也需要電腦的系統管理權限。However, they also require administrative privileges on the machine. 您可以在 .NET 下載頁面上找到要安裝的 SDK。You can find the SDK to install on the .NET downloads page.

另一方面,安裝指令碼不需要系統管理權限。Install scripts, on the other hand, don't require administrative privileges. 不過,它們也不會在電腦上安裝任何必要條件;您需要手動安裝所有必要條件。However, they also don't install any prerequisites on the machine; you need to install all of the prerequisites manually. 指令碼大部分用於設定組建伺服器,或您想要安裝工具但沒有系統管理權限時 (請確實注意上述先決條件警告)。The scripts are meant mostly for setting up build servers or when you wish to install the tools without admin privileges (do note the prerequisites caveat above). 您可在安裝指令碼參考一文中取得需詳細資訊。You can find more information in the install script reference article. 如對如何在 CI 組建伺服器上設定 SDK 有興趣,請參閱在持續整合 (CI) 中使用 .NET Core SDK 和工具一文。If you're interested in how to set up the SDK on your CI build server, see the Using .NET Core SDK and tools in Continuous Integration (CI) article.

根據預設,SDK 會以「並存」(SxS)的方式安裝,這表示單一電腦上的任何指定時間都可以共存多個版本。By default, the SDK installs in a "side-by-side" (SxS) manner, which means multiple versions can coexist at any given time on a single machine. 如需了解執行 CLI 命令時如何挑選版本的詳細說明,請參閱選取要使用的 .NET Core 版本一文。How the version gets picked when you're running CLI commands is explained in more detail in the Select the .NET Core version to use article.

請參閱See also