.NET Core 裝載套件組合The .NET Core Hosting Bundle

.NET Core 裝載套件組合是 .NET Core 執行時間和 ASP.NET Core 模組的安裝程式。The .NET Core Hosting bundle is an installer for the .NET Core Runtime and the ASP.NET Core Module. 套件組合可讓 ASP.NET Core 的應用程式與 IIS 搭配執行。The bundle allows ASP.NET Core apps to run with IIS.

安裝 .NET Core 裝載套件組合Install the .NET Core Hosting Bundle

重要

若裝載套件組合在 IIS 之前安裝,則必須對該套件組合安裝進行修復。If the Hosting Bundle is installed before IIS, the bundle installation must be repaired. 請在安裝 IIS 之後,再次執行裝載套件組合安裝程式。Run the Hosting Bundle installer again after installing IIS.

如果在安裝 64 位元 (x64) 版本的 .NET Core 後才安裝裝載套件組合,那麼可能會遺漏 SDK (未偵測到 .NET Core SDK)。If the Hosting Bundle is installed after installing the 64-bit (x64) version of .NET Core, SDKs might appear to be missing (No .NET Core SDKs were detected). 若要解決此問題,請參閱 針對 ASP.NET Core 專案進行疑難排解和調試To resolve the problem, see 針對 ASP.NET Core 專案進行疑難排解和調試.

公告存放庫中會報告重大變更和資訊安全摘要報告。Breaking changes and security advisories are reported on the Announcements repo. 您可以藉由選取 標籤 篩選器,將宣告限制為特定版本。Announcements can be limited to a specific version by selecting a Label filter.

直接下載 (目前版本)Direct download (current version)

使用下列連結下載安裝程式:Download the installer using the following link:

目前的 .NET Core 裝載套件組合安裝程式 (直接下載)Current .NET Core Hosting Bundle installer (direct download)

C++ 可轉散發套件需求Visual C++ Redistributable Requirement

在舊版 Windows (例如 Windows Server 2012 R2)上,安裝 Visual Studio c + + 2015、2017、2019可轉散發套件。On older versions of Windows, for example Windows Server 2012 R2, install the Visual Studio C++ 2015, 2017, 2019 Redistributable. 否則,Windows 事件記錄檔中混淆的錯誤訊息會報告 The data is the error.Otherwise, a confusing error message in the Windows Event Log reports that The data is the error.

目前的 X64 與 c + + 可轉散發套件目前的 X86 與 c + +可轉散發套件Current x64 VS C++ redistributable Current x86 VS C++ redistributable

安裝程式的先前版本Earlier versions of the installer

若要取得安裝程式的先前版本:To obtain an earlier version of the installer:

  1. 流覽至 [ 下載 .Net Core ] 頁面。Navigate to the Download .NET Core page.
  2. 選取所需的 .NET Core 版本。Select the desired .NET Core version.
  3. 在 [執行應用程式 - 執行階段] 欄中,尋找想要的 .NET Core 執行階段版本列。In the Run apps - Runtime column, find the row of the .NET Core runtime version desired.
  4. 使用 裝載 套件組合連結來下載安裝程式。Download the installer using the Hosting Bundle link.

警告

某些安裝程式包含已達到期生命週期結束 (EOL) 的發行版本,這些發行版本已不受 Microsoft 支援。Some installers contain release versions that have reached their end of life (EOL) and are no longer supported by Microsoft. 如需詳細資訊,請參閱支援原則 (英文 )。For more information, see the support policy.

選項Options

  1. 從系統管理員命令殼層執行安裝程式時,有 下列參數可用:The following parameters are available when running the installer from an administrator command shell:

    • OPT_NO_ANCM=1:略過安裝 ASP.NET Core 模組。OPT_NO_ANCM=1: Skip installing the ASP.NET Core Module.
    • OPT_NO_RUNTIME=1:略過安裝 .NET Core 執行時間。OPT_NO_RUNTIME=1: Skip installing the .NET Core runtime. 當伺服器僅裝載 獨立部署 (SCD) 時使用。Used when the server only hosts self-contained deployments (SCD).
    • OPT_NO_SHAREDFX=1:略過安裝 ASP.NET 共用架構 (ASP.NET 執行時間) 。OPT_NO_SHAREDFX=1: Skip installing the ASP.NET Shared Framework (ASP.NET runtime). 當伺服器僅裝載 獨立部署 (SCD) 時使用。Used when the server only hosts self-contained deployments (SCD).
    • OPT_NO_X86=1:略過安裝 x86 執行時間。OPT_NO_X86=1: Skip installing x86 runtimes. 當您確定不會裝載 32 位元應用程式時,請使用此參數。Use this parameter when you know that you won't be hosting 32-bit apps. 如果將來有可能同時裝載 32 位元和 64 位元應用程式,請不要使用此參數並安裝這兩個執行階段。If there's any chance that you will host both 32-bit and 64-bit apps in the future, don't use this parameter and install both runtimes.
    • OPT_NO_SHARED_CONFIG_CHECK=1:當共用設定 (applicationHost.config) 位於與 IIS 安裝相同的電腦上時,請停用 Iis 共用設定的檢查。OPT_NO_SHARED_CONFIG_CHECK=1: Disable the check for using an IIS Shared Configuration when the shared configuration (applicationHost.config) is on the same machine as the IIS installation. 只在 ASP.NET Core 2.2 或更新版本的裝載套件組合安裝程式上可用。Only available for ASP.NET Core 2.2 or later Hosting Bundler installers. 如需詳細資訊,請參閱ASP.NET Core 模組For more information, see ASP.NET Core 模組.

注意

如需 IIS 共用組態的資訊,請參閱使用 IIS 共用組態的 ASP.NET Core 模組For information on IIS Shared Configuration, see ASP.NET Core Module with IIS Shared Configuration.

重新啟動 IISRestart IIS

安裝裝載套件組合之後,可能需要手動重新開機 IIS。After the Hosting Bundle is installed, a manual IIS restart may be required. 例如, dotnet CLI 工具 (命令) 可能不在執行 IIS 背景工作進程的路徑上。For example, the dotnet CLI tooling (command) might not exist on the PATH for running IIS worker processes.

若要手動停止和啟動 IIS,請在提高許可權的命令 shell 中執行下列命令:To manually stop and start IIS, execute the following commands in an elevated command shell:

net stop was /y
net start w3svc

模組版本和裝載套件組合安裝程式記錄檔Module version and Hosting Bundle installer logs

判斷已安裝的 ASP.NET Core 模組版本:To determine the version of the installed ASP.NET Core Module:

  1. 在主控系統上,流覽至 %PROGRAMFILES%\IIS\Asp.Net Core Module\V2On the hosting system, navigate to %PROGRAMFILES%\IIS\Asp.Net Core Module\V2.
  2. 找出檔案 aspnetcorev2.dllLocate the aspnetcorev2.dll file.
  3. 在該檔案上按一下滑鼠右鍵,然後從關聯式功能表中選取 [內容]。Right-click the file and select Properties from the contextual menu.
  4. 選取 [ 詳細資料 ] 索引標籤。檔案 版本產品版本 代表已安裝的模組版本。Select the Details tab. The File version and Product version represent the installed version of the module.

模組的裝載套件組合安裝程式記錄檔位於 C:\Users\%UserName%\AppData\Local\TempThe Hosting Bundle installer logs for the module are found at C:\Users\%UserName%\AppData\Local\Temp. 檔案的名稱 dd_DotNetCoreWinSvrHosting__{TIMESTAMP}_000_AspNetCoreModule_x64.log ,其中預留位置是檔案的 {TIMESTAMP} 時間戳記。The file is named dd_DotNetCoreWinSvrHosting__{TIMESTAMP}_000_AspNetCoreModule_x64.log, where the placeholder {TIMESTAMP} is the timestamp of the file.