ASP.NET Core 中斷性變更 | Microsoft Learn

资讯 2024-07-09 阅读:20 评论:0
美化布局示例

欧易(OKX)最新版本

【遇到注册下载问题请加文章最下面的客服微信】永久享受返佣20%手续费!

APP下载   全球官网 大陆官网

币安(Binance)最新版本

币安交易所app【遇到注册下载问题请加文章最下面的客服微信】永久享受返佣20%手续费!

APP下载   官网地址

火币HTX最新版本

火币老牌交易所【遇到注册下载问题请加文章最下面的客服微信】永久享受返佣20%手续费!

APP下载   官网地址

ASP.NET Core 提供 .NET Core 所使用的 Web 應用程式開發功能。

ASP.NET Core provides the web application development function for.NET Core.

選取下列其中一個連結,以了解特定版本中的中斷性變更:

Select one of the following links to understand the break-in changes in a given version:

下列 ASP.NET Core 3.0 和 3.1 中的中斷性變更記載於此頁面:

The following break-in changes in ASP.NET Core 3.0 and 3.1 are posted on this page:

部分瀏覽器 (例如 Chrome 及 Firefox) 針對 的 Cookie 實作進行中斷性變更。 變更內容會影響遠端驗證情節,例如 OpenID Connect 和 WS-Federation,二者皆必須透過傳送 退出宣告。 不過, 會在 iOS 12 及其他瀏覽器的部分較舊版本上中斷。 應用程式必須探查這些版本,並忽略 。

Partial browsers (e. g. Chrome and Firefox) are used to interrupt cookies. Changing content affects remote proofs, such as OpenID Connect and WS-Fundation, both of which have to exit through transmission. However, they will be interrupted on iOS 12 and other old versions of browsers. The application must look at these versions and ignore them.

如需此問題的討論,請參閱 dotnet/aspnetcore#14996

For any discussion on this issue, please refer to dotnet/aspnetcore#14996.

導入的版本

3.1 預覽版 1

3.1 Preview 1

舊的行為

是 HTTP Cookie 的 2016 草稿標準延伸模組。 其用意在於降低跨網站偽造要求 (CSRF) 的風險。 原初設計時,這項功能需伺服器新增參數才能加入。 ASP.NET Core 2.0 針對 新增初始支援。

It is a standard extension module for HTTP Cookie's 2016 draft. It is intended to reduce the risk of trans-site forgery requirements (CSRF). At the time of the original design, this feature would need to be added by the server. ASP.NET Core 2.0 for additional initial support.

新的行為

Google 提議了不具回溯相容性的新版草稿標準。 這項標準會改變 的預設模式並增加新項目 來退出宣告。 已可滿足多數應用程式 Cookie 的需求,但會使跨網站情節 (例如 OpenID Connect 和 WS-Federation 登入) 中斷。 由於要求流程的差異,多數 OAuth 登入不會受到影響。 針對實作之前草稿標準 (例如 iOS 12) 的用戶端,新的 參數會造成相容性問題。 Chrome 80 將包含變更內容。 請參閱 SameSite Updates 了解 Chrome 產品啟動時間表。

Google proposed new draft standards for non-retroactivity. This standard will change the default pattern and add new items to exit the announcement. The multiplicity of applications Cookie needs have been met, but will result in a breakdown of trans-site scenarios (e.g. OpenID Connect and WS-Fundation). Many OAuth logins will not be affected because of the differences in the process required. New parameters will create compatibility problems with the previous draft standard (e.g. iOS 12). Chrome 80 will contain changes. See for the start-up schedule of products.

ASP.NET Core 3.1 已更新來實作新的 行為。 更新內容重新定義了 的行為來發出 ,並增加新的 值來忽略 屬性。 現在所有 Cookie API 預設為 ,不過部分使用 Cookie 的元件會針對各自的情節設定專特的值,例如 OpenID Connect 相互關聯及 nonce Cookie。

ASP.NET Core 3.1 has been updated to implement new practices. The update redefines the behaviour to be released and adds new values to ignore properties. All cookies APIs are now defaulted on, but partial use of cookies sets specific values for their respective scenarios, such as OpenID Concept connections and nonece Cookie.

如需此方面的其他近期變更內容,請參閱 HTTP:部分 Cookie SameSite 預設值變更為 None。 在 ASP.NET Core 3.0 中,多數預設值已從 SameSiteMode.Lax 變更為 SameSiteMode.None (但仍使用先前的標準)。

For any other recent changes in this area, please refer to .

變更原因

基於前文所述的瀏覽器和規格變更。

On the basis of the above-mentioned browsers and changes in regulations.

與遠端站台互動的應用程式 (例如透過第三方登入者) 必須:

Applications that interact with remote stations (e.g. through third-party entrants) must:

如需測試和瀏覽器探查指示,請參閱下列小節。

For testing and browser survey instructions, please refer to the following subsections.

判斷自己是否受到影響

用可選擇加入新行為的用戶端版本測試您的 Web 應用程式。 Chrome、Firefox 和 Microsoft Edge Chromium 都有可用於測試的新版選擇加入功能旗標。 請於套用修補檔後使用舊版用戶端版本確認應用程式可相容,Safari 尤其需要確認。 如需詳細資訊,請參閱支援舊版瀏覽器

Check your Web application with a client version that you can choose to add to the new line. Chrome, Firefox and Microsoft Edge Chromium have new versions that can be tested for adding functional flags. Use the old version of the client version to confirm the compatibility of the application after applying the patches, especially Safari. See for more details.

Chrome

Chrome 78 和更新版本會產生誤導的測試結果。 這些版本已有暫時風險降低功能,能允許兩分鐘內的 Cookie 存在。 啟用適當的測試旗標後,Chrome 76 和 77 就能獲得更精準的結果。 若要測試新行為,請將 切換為啟用。 目前已知 Chrome 75 和更早的版本會在使用新的 設定時失敗。 如需詳細資訊,請參閱支援舊版瀏覽器

Chrome 78 and the updated version will produce erroneous results. These versions have a temporary risk reduction function that allows cookies to exist within two minutes. With the introduction of suitable test flags, Chrome 76 and 77 will have more accurate results. To test new behaviors, switch them to start. The more known versions of Chrome 75 and earlier will fail when using new settings. See for details.

Google 不提供較舊的 Chrome 版本。 不過,您可下載舊版 Chromium 以供測試。 請遵循下載 Chromium 中的指示。

Google does not provide an older Chrome version. However, you can download the old Chromium for testing. Please follow instructions from .

Safari

Safari 12 嚴格實作先前的草稿,如果系統在 Cookie 中發現新的 值,則會失敗。 請務必透過支援舊版瀏覽器中示範的瀏覽器探查程式碼來防範。 務必使用 Microsoft 驗證程式庫 (MSAL)、Active Directory 驗證程式庫 (ADAL) 或任何您正在使用的程式庫測試 Safari 12 和 13,以及 Webkit 型的 OS 式登入。 問題相依於基礎 OS 版本。 目前已知 OSX Mojave 10.14 和 iOS 12 會與新行為發生相容性問題。 升級至 OSX Catalina 10.15 或 iOS 13 能修正這個問題。 目前 Safari 不針對測試新規格行為提供選擇加入旗標。

Safari 12 Strictly enforces previous drafts, failing if the system finds new values in Cookie. Do not hesitate to use . Question is based on the use of the Microsoft Validation Program Library (MSAL), the Active Directory Validation Library (ADAL) or any program that you are using to test Safari 12 and 13, and the use of the Webkit-type OS 13 to update the OS 13 flag.

Firefox

Firefox 支援在 68 和更新版本中測試新標準,方法是在 分頁上選擇加入並搭配功能旗標 。 目前舊版 Firefox 並沒有已知的相容性問題。

Firefox supports testing new standards in 68 and updated versions by choosing to add and match functional flags on tabs. The old Firefox does not have any known compatibility problems.

Microsoft Edge

雖然 Microsoft Edge 支援舊版 標準,從 44 版開始也不再與新標準有任何相容性問題。

Although Microsoft Edge supports the old version of the standard, it has not been compatible with the new standard since the 44th edition.

Microsoft Edge Chromium

功能旗標為 。 使用 Microsoft Edge Chromium 78 測試時未發現相容性問題。

The functional flag is marked. No compatibility problems were found at the Microsoft Edge Chromium 78 test.

Electron

Electron 的版本包括舊版 Chromium。 例如,Microsoft Teams 使用的 Electron 版本為展現舊版行為的 Chromium 66。 請用您產品使用的 Electron 版本執行自己的相容性測試。 如需詳細資訊,請參閱支援舊版瀏覽器

The Elementron version includes the old Chromium. For example, Microsoft Teams uses the Electric version as Chromium 66 for displaying the behaviour of the older version. Please run your compatibility test using the Electric version of your product. See for details.

支援舊版瀏覽器

2016 標準強制將未知的值視為 值。 因此,任何支援原始標準的舊版瀏覽器,都會在發現有 值的 屬性時中斷。 如果 Web 應用程式欲支援這些舊版瀏覽器,則必須實作瀏覽器探查功能。 ASP.NET Core 不會為您實作瀏覽器探查功能,因為 要求標頭的值非常不穩定,每週都會改變。 反之,Cookie 原則中的擴充點可讓您新增 特定的邏輯。

The standard mandatory 2016 treats unknown values as values. Therefore, any old browser that supports the original standard will be interrupted when the properties of the values are found. If the Web application is to support these old browsers, the browser search function will have to be implemented. ASP.NET Core will not do a browser search function for you because the required top values are very unstable and will change every week. Cookie's originals, on the other hand, expand points will allow you to add a specific logic.

Startup.cs 中,新增下列程式碼:

In Startup.cs, add the following code:


退出宣告參數

相容性參數可讓您暫時退出新的 ASP.NET Core Cookie 行為。 在專案的 runtimeconfig.template.json 檔案中新增下列 JSON:

Compatibility parameters allow you to withdraw temporarily from the new ASP.NET Core Cookie. Add the following JSON to the project file runteconfig.template.json:


其他版本

相關的 修補檔即將為以下項目推出:

The associated patches will be launched for the following items:

  • ASP.NET Core 2.1、2.2 和 3.0
  • 4.1
  • (適用於 .NET Framework 4.7.2 和更新版本)

類別

ASP.NET

受影響的 API


已移除 ASP.NET Core 2.2 中淘汰的成員和相容性參數。

Removed membership and compatibility parameters from ASP.NET Core.2.

導入的版本

3.0

變更原因

隨著時間改善 API 介面。

Improve the API interface over time.

以 .NET Core 2.2 為目標時,請遵循淘汰組建訊息中的指引,改為採用新的 API。

With the goal of.NET Core 2.2, follow the guidelines in the phase-out group building message and replace it with a new API.

類別

ASP.NET Core

受影響的 API

下列類型和成員在 ASP.NET Core 2.1 和 2.2 中標示為已淘汰:

The following types and members were marked as phased out in ASP.NET Core 2.1 and 2.2:

類型

Type

建構函式

Constructive Function

屬性

Properties

方法

Method


Google 從 2019 年 1 月 28 日開始,關閉應用程式的 Google+ 登入。

Google started on January 28, 2019, applications.

變更描述

ASP.NET 4.x 和 ASP.NET Core 已使用 Google+ 登入 API 在 Web 應用程式中驗證 Google 帳戶使用者。 受影響的 NuGet 套件為適用於 ASP.NET Core 的 Microsoft.AspNetCore.Authentication.Google,以及具有 ASP.NET Web Forms 和 MVC 的 所適用的 Microsoft.Owin.Security.Google

ASP.NET 4.x and ASP.NET Core have used Google+ to authenticate Google account users in the Web application. The affected NuGet package is .

Google 的替代 API 使用不同的資料來源和格式。 以下提供已納入結構變更考量的風險降低和解決方案。 應用程式應確認資料本身是否仍符合其需求。 例如,名稱、電子郵件地址、設定檔連結和設定檔相片所提供的值可能會和之前略為不同。

The alternative API for Google uses different data sources and formats. The following offers the risk reduction and resolution options for the built-in changes. The application should make sure that the data itself meets its needs. For example, the values provided by the name, email address, configuration file links and configuration file photos may be slightly different.

導入的版本

所有版本。 這是 ASP.NET Core 外部的變更。

This is an external ASP.NET Core change.

具有 ASP.NET Web Form 和 MVC 的 Owin

針對 3.1.0 和更新版本,此處概述暫時性風險降低功能。 應用程式應該使用風險降低來完成測試,以確認資料格式是否發生變更。 有計劃配合修正發行 4.0.1。 使用任何舊版的應用程式應更新為 4.0.1 版。

For , the temporary risk reduction function is outlined. The application should use risk reduction to complete the test to confirm whether the data format has changed. There are plans to accompany the revision to release 4.1.1. Update version 4.1 using any old application.

ASP.NET Core 1.x

具有 ASP.NET Web Form 和 MVC 的 Owin 風險降低,可以調整為 ASP.NET Core 1.x。 未規劃 NuGet 套件修補程式,因為 1.x 已達到生命週期結束狀態。

risk reduction to adjust to ASP.NET Core 1.x. Unscheduled Nuget package repair because 1.x has reached

ASP.NET Core 2.x

若為 2.x 版,請使用下列程式碼取代 中 的現有呼叫:

For version 2.x, replace the current call with the following code:


2 月 2.1 和 2.2 修補程式已納入上述重新設定作為新的預設值。 ASP.NET Core 2.0 未規劃修補檔,因為已經達到生命週期結束階段

2.1 and 2.2 fixes have been incorporated into the above resets as new defaults. ASP.NET Core 2.0 unscheduled fixes since at the end of the life cycle.

ASP.NET Core 3.0

針對 ASP.NET Core 2.x 提供的風險降低功能也可用於 ASP.NET Core 3.0。 在未來的 3.0 預覽版中,可能會移除 套件。 系統會改為將使用者導向至 。 下列程式碼示範如何在 中將 取代為 。 此取代可以搭配 ASP.NET Core 2.0 和更新版本使用,並可視需要針對 ASP.NET Core 1.x 進行調整。

The risk-reduction function provided by ASP.NET Core 2.x can also be used in ASP.NET Core 3.0. In future 3.0 previews, the package may be removed. The system will be redirected to the user. How the following code example will be replaced. This replacement can be used with ASP.NET Core 2.0, which can be adapted to the needs of ASP.NET Core 1.x.


類別

ASP.NET Core

受影響的 API

Microsoft.AspNetCore.Authentication.Google


已移除 被取代的 屬性。

Removed properties.

變更描述

dotnet/aspnetcore#6504 中,已移除 中被取代的 屬性。 自 2.0 後, 屬性已被取代。 已發行移轉指南,將使用這個已被取代屬性的程式碼移轉至新的取代 API。 其餘與舊版 ASP.NET Core 1.x 驗證堆疊相關的未使用類別/API 均已移除,確認符合 dotnet/aspnetcore@d7a7c65 的內容。

After , the removed properties have been replaced. Since 2.0, properties have been replaced.

若要了解相關討論,請參閱 dotnet/aspnetcore#6533

For more information on the discussion, please visit dotnet/aspnetcore#6533.

導入的版本

3.0

變更原因

ASP.NET Core 1.0 API 已由 Microsoft.AspNetCore.Authentication.AuthenticationHttpContextExtensions 中的擴充方法取代。

ASP.NET Core 1.0 API has been replaced by an extended method in .

請參閱移轉指南

Please refer to Migration Guide.

類別

ASP.NET Core

受影響的 API


在 ASP.NET Core 3.0 中,驗證 API 中使用的 類型已取代為 類型。 除了下列情況外,驗證套件的基本用法依然不受影響:

In ASP.NET Core 3.0, the type used to verify API has been replaced with the type. The basic use of the authentication package remains unaffected except in the following cases:

  • 衍生自 OAuth 提供者的類別,例如來自 aspnet-contrib 的類別。
  • 進階宣告操作實作。

如需詳細資訊,請參閱 dotnet/aspnetcore#7105。 若要了解相關討論,請參閱 dotnet/aspnetcore#7289

For more information, please refer to dotnet/aspnetcore#7105. For more information on this discussion, refer to .

導入的版本

3.0

對於衍生的 OAuth 實作,最常見的變更是在 覆寫中將 取代為 ,如此處所示。 會實作 。

For derivative OAuth implementation, the most common change is to replace it with .

下列清單列出已知變更項目:

The following list lists known changes:

類別

ASP.NET Core

受影響的 API


在 ASP.NET Core 3.0 中, 的簽章變更自:

In ASP.NET Core 3.0, the signature changes from:


變更為:

Change to:


導入的版本

3.0

舊的行為

和 字串是以個別引數的形式傳遞。

and Strings are transmitted in the form of a different argument.

新的行為

和 是 上的屬性,可透過 建構函式設定。 新的 型別是唯一傳遞至 的引數。

and is the attribute that can be set through the Constructive Function. The new type is the only argument passed to.

變更原因

這項變更允許以非中斷方式提供其他參數。 不需要建立新的 多載。

This change allows other parameters to be provided in a non-interruptible manner. No new multiloading is required.

使用適當的 和 值建構 。 必須提供 AuthenticationProperties 執行個體。 這個單一的 執行個體可以傳遞至 ,而不是多個引數。

Use appropriate and value structures.

類別

ASP.NET Core

受影響的 API

OAuthHandler<TOptions>.ExchangeCodeAsync(String, String)


用來放置在 的核心 方法已重新命名為 。 舊的 方法仍然存在,但會改為位於 組件中。 使用這兩種方法的應用程式應該不會有任何影響。 請注意, 現在隨附於共用架構中,而不是獨立套件,如共用架構:從 Microsoft.AspNetCore.App 移除的組件中所述。

An application using these two methods should have no effect. Note that it is now attached to a common setup rather than to a stand-alone package such as

導入的版本

3.0

舊的行為

方法已存在於 中。

Method already exists.

新的行為

方法存在於 中。 是舊方法的新名稱。

Method exists. This is the new name of the old method.

變更原因

是較佳的方法名稱,可用於新增授權所需的所有通用服務。

is the preferred method name for all common services required for the new authorization.

請新增參考至 或改用 。

Please add a reference to or change it.

類別

ASP.NET Core

受影響的 API

Microsoft.Extensions.DependencyInjection.AuthorizationServiceCollectionExtensions.AddAuthorization(IServiceCollection, Action<AuthorizationOptions>)


自 ASP.NET Core 3.0 起,MVC 不會針對控制器和動作方法上探索到的 [AllowAnonymous] 屬性新增 AllowAnonymousFilters。 這項變更是為了處理本機環境中 AuthorizeAttribute 的衍生項目,但屬於 IAsyncAuthorizationFilterIAuthorizationFilter 實作的中斷性變更。 這類實作包裝在 [TypeFilter] 屬性中,是一種熱門且受支援的方式,可以在需要設定和相依性插入時實行強型別的屬性型授權。

Starting with ASP.NET Core 3.0, MVC does not address > > > < http://doclos.microtorte.mv.authization.alumonymofscoltsat >

導入的版本

3.0

舊的行為

IAllowAnonymous 出現在 AuthorizationFilterContext.Filters 集合中。 測試介面是否存在,是在個別控制器方法中覆寫或停用篩選的有效方法。

新的行為

不再出現在 集合中。 相依於舊行為的實作通常會產生「HTTP 401 未授權」或「HTTP 403 禁止回應」間歇性錯誤。

Do not appear in the assembly. The implementation that follows the old behavior usually results in an occasional error of "HTTP 401 not authorized" or "HTTP 403 not allowed to respond".

變更原因

ASP.NET Core 3.0 中導入了新的端點路由策略。

A new peer route strategy has been introduced in ASP.NET Core 3.0.

在端點中繼資料中搜尋 。 例如:

Search in peer metadata. For example:


本 HasAllowAnonymous 方法檢視這項技術的範例。

At .

類別

ASP.NET Core

受影響的 API

None


在 ASP.NET Core 3.0 中,已將新的 方法新增至 。 未指定任何原則時,授權中介軟體會使用此後援原則。

In ASP.NET Core 3.0, new methods have been added. If no principle has been specified, the authorized intermediary will use this backup.

如需詳細資訊,請參閱 dotnet/aspnetcore#9759

For more information, please visit dotnet/aspnetcore#9759.

導入的版本

3.0

舊的行為

的實作不需要 方法。

There's no need for a way to do this.

新的行為

的實作需要 方法。

The way it's done needs to be done.

變更原因

未指定任何原則時,需要新的方法才能使用新的 。

When no principles are specified, a new method is needed to use the new one.

將 方法新增至 的實作。

Adds a new method to the implementation.

類別

ASP.NET Core

受影響的 API

Microsoft.AspNetCore.Authorization.IAuthorizationPolicyProvider


ASP.NET Core 3.0 版本已移除淘汰的 MemoryCacheOptions API

ASP.NET Core version 3.0 has removed

變更描述

這項變更是 aspnet/Caching#221 的後續動作。 如需了解相關討論,請參閱 dotnet/extensions#1062

This change is a follow-up to . See .

導入的版本

3.0

舊的行為

屬性可供使用。

Properties are available.

新的行為

已移除 屬性。

Removed attribute.

變更原因

自動壓縮快取會導致問題。 若要避免非預期的行為,只在必要時才壓縮快取。

Self-pressurized caches can cause problems. To avoid undesired behavior, they are compressed only when necessary.

若要壓縮快取,請視需要向下轉型至 並呼叫 。

To squeeze the cache, see the need to turn down to and call.

類別

ASP.NET Core

受影響的 API

MemoryCacheOptions.CompactOnMemoryPressure


套件會使用新的 套件,而不是 套件。 這項變更可能會導致少數行為性中斷性變更。 如需詳細資訊,請參閱新的 Microsoft.Data.SqlClient 簡介

The package will use a new package instead of a package. This change may lead to a few behavioral break-up changes. See for details.

導入的版本

3.0

舊的行為

套件使用 套件。

Package use package.

新的行為

現在是使用 套件。

Now is using the package.

變更原因

是依據 建置的新套件。 從現在開始,所有新功能的工作都在這裡執行。

It's based on a new package, and from now on, all new functions are performed here.

除非客戶使用 套件所傳回的型別,並將其轉換成 型別,否則客戶不需要擔心這項中斷性變更。 例如,如果有人將 轉換成舊的 SqlConnection 型別,則必須將轉換變更為新的 型別。

For example, if someone converts to the old SqlConnection , it must change to a new type.

類別

ASP.NET Core

受影響的 API

None


在 ASP.NET Core 3.0 中, 中的「pubternal」類型已變更為 。

In ASP.NET Core 3.0, the "pubternal" type has been changed.

此外, 和 的預設實作不會再新增至服務作為 方法的一部分。

In addition, and the default will no longer be added to the service as part of the methodology.

變更描述

在 ASP.NET Core 中,「pubternal」類型會宣告為 ,但會放置在尾碼為 的命名空間中。 雖然這些型別是公用的,但沒有支援原則,而且可能會發生中斷性變更。 可惜的是,這些型別經常會被意外使用,導致這些專案出現中斷性變更,並限制維護架構的能力。

In ASP.NET Core, the "pubternal" type will be declared, but it will be placed in the namespace at the end. While these types are common, there are no supporting principles, and there may be disruptions.

導入的版本

3.0

舊的行為

這些型別是公開可見的,但不受支援。

These are public, but not supported.

新的行為

這些型別現在為 。

These are the types now.

變更原因

範圍更能反映不支援的原則。

The scope reflects the principle of non-supportiveness.

複製應用程式或程式庫所使用的型別。

The type to be used in a copy application or library.

類別

ASP.NET Core

受影響的 API


取決於 Azure 儲存體程式庫。 這些程式庫已重新命名其組件、套件和命名空間。 從 ASP.NET Core 3.0 開始, 會使用加上 前置詞的新 API 和套件。

Depending on . These libraries have renamed their components, packages and naming spaces. Starting with ASP.NET Core 3.0, new APIs and packages with prefixes will be used.

若要了解 Azure 儲存體 API 相關問題,請使用 https://github.com/Azure/azure-storage-net。 如需了解有關此問題的討論,請參閱 dotnet/aspnetcore#19570

For information on Azure's API, please use . For information on this issue, see .

導入的版本

3.0

舊的行為

此套件之前是參考 NuGet 套件。 此套件現在參考 NuGet 套件。

This package was previously referred to in the NuGet package. This package is now referred to in the NuGet package.

新的行為

此套件現在參考 NuGet 套件。

This package is now referred to in the NuGet package.

變更原因

這項變更可讓 移轉至建議的 Azure 儲存體套件。

This change allows you to move to the recommended Azure storage package.

如果您仍然需要搭配 ASP.NET Core 3.0 使用舊版 Azure 儲存體 API,請將直接相依性新增至套件 WindowsAzure.StorageMicrosoft.Azure.Storage。 此套件可以與新的 API 一起安裝。

If you still need to go with ASP.NET Core 3.0 using the old Azure Storage API, add a new direct dependencies package to or . This set can be installed with the new API.

在許多情況下,升級只會牽涉到 陳述式變更為使用新的命名空間:

In many cases, the upgrade will only involve a narrative change to use a new name space:


類別

ASP.NET Core

受影響的 API

None


從 ASP.NET Core 3.0 開始,Windows 裝載套件組合不包含 AspNetCoreModule (ANCM) V1。

Starting with ASP.NET Core 3.0, the Windows load package combination does not contain AspNetCoreModule (ANCM) V1.

ANCM V2 與 ANCM OutOfProcess 回溯相容,建議搭配 ASP.NET Core 3.0 應用程式使用。

ANCM V2 is retroactively compatible with ANCM OutofProcess and is advised to match ASP.NET Core 3.0 applications.

若要了解相關討論,請參閱 dotnet/aspnetcore#7095

For more information on the discussion, please visit dotnet/aspnetcore#7095.

導入的版本

3.0

舊的行為

ANCM V1 包含在 Windows 裝載套件組合中。

ANCM V1 is contained in Windows loading packages.

新的行為

ANCM V1 未包含在 Windows 裝載套件組合中。

ANCM V1 is not contained in Windows loading packages.

變更原因

ANCM V2 與 ANCM OutOfProcess 回溯相容,建議搭配 ASP.NET Core 3.0 應用程式使用。

ANCM V2 is retroactively compatible with ANCM OutofProcess and is advised to match ASP.NET Core 3.0 applications.

搭配 ASP.NET Core 3.0 應用程式使用 ANCM V2。

Combining ASP.NET Core 3.0 applications uses ANCM V2.

如果需要 ANCM V1,可以使用 ASP.NET Core 2.1 或 2.2 Windows 裝載套件組合來安裝。

If ANCM V1 is required, you can install it using ASP.NET Core 2.1 or 2.2 Windows Load Package Combining.

這項變更會中斷符合下列條件的 ASP.NET Core 3.0 應用程式:

This change will interrupt ASP.NET Core 3.0 applications that meet the following conditions:

  • 明確選擇使用 ANCM V1 搭配 。
  • 取得自訂 web.config 檔案,其中含有 。

類別

ASP.NET Core

受影響的 API

None


泛型主機唯一支援 類別建構函式插入的型別為 、 和 。 使用 的應用程式不會受到影響。

The type, and the type, for which the type of construction function is inserted, is the only type supported by the general host. The application used will not be affected.

變更描述

在 ASP.NET Core 3.0 之前,建構函式插入可用於 類別建構函式中的任意類型。 在 ASP.NET Core 3.0 中,Web 堆疊已按平台重新設定為泛型主機程式庫。 您可以在範本的 Program.cs 檔案中看到變更:

Prior to ASP.NET Core 3.0, the construction function inserts any type that can be used in the type construction function. In ASP.NET Core 3.0, the Web stack has been reconfigured to a broad host library by the platform. You can see changes in the template file Program.cs:

ASP.NET Core 2.x:

https://github.com/dotnet/aspnetcore/blob/5cb615fcbe8559e49042e93394008077e30454c0/src/Templating/src/Microsoft.DotNet.Web.ProjectTemplates/content/EmptyWeb-CSharp/Program.cs#L20-L22

ASP.NET Core 3.0:

https://github.com/dotnet/aspnetcore/blob/b1ca2c1155da3920f0df5108b9fedbe82efaa11c/src/ProjectTemplates/Web.ProjectTemplates/content/EmptyWeb-CSharp/Program.cs#L19-L24

使用一個相依性插入 (DI) 容器來建置應用程式。 使用兩個容器:一個用於主機,另一個用於應用程式。 因此, 建構函式不再支援自訂服務插入。 只能插入 、 和 。 這項變更可防止 DI 問題,例如重複建立單一資料庫服務問題。

Use a dependencies insert (DI) container to build an application. Use two containers: one for the host and the other for the application. Therefore, the construction function no longer supports custom service insertion. Only insert, and. This change will prevent DI problems, such as duplicate creation of a single database service.

導入的版本

3.0

變更原因

這項變更是將 Web 堆疊重新按平台設定為泛型主機程式庫的結果。

This change is the result of the repositioning of the web stacks to the platform's general host library.

將服務插入 方法簽章。 例如:

Insert service into method signature. For example:


類別

ASP.NET Core

受影響的 API

None


ASP.NET Core 模組 (ANCM) 13.0.19218.0 版可透過 IIS 跨處理序裝載,為 ASP.NET Core 3.0 和 2.2 應用程式啟用現有的 HTTPS 重新導向功能。

ASP.NET Core Module (ANCM)13.19218.0 is available through IIS trans-processing sequences for ASP.NET Core 3.0 and 2.2 applications to enable existing HTTPS reorientation functions.

若要了解相關討論,請參閱 dotnet/AspNetCore#15243

For more information on the discussions, please refer to dotnet/AspNetCore#15243.

導入的版本

3.0

舊的行為

ASP.NET Core 2.1 專案範本首先導入了 HTTPS 中介軟體方法的支援,例如 UseHttpsRedirectionUseHsts。 啟用 HTTPS 重新導向需要新增設定,因為開發中的應用程式不會使用預設連接埠 443。 只有在要求已經使用 HTTPS 時,HTTP 嚴格傳輸安全性 (HSTS) 才會作用。 依預設,系統會略過 Localhost。

ASP.NET Core 2.1 project template has initially led to support for HTTPS intermediate software methods, such as and

新的行為

在 ASP.NET Core 3.0 中,IIS HTTPS 案例已增強。 透過增強功能,應用程式可以探索伺服器的 HTTPS 連接埠,並依預設使 運作。 同處理序元件使用 功能完成連接埠探索,此功能只會影響 ASP.NET Core 3.0 應用程式,因為同處理序程式庫是透過架構進行版本設定的。 跨處理序元件已變更為自動新增 環境變數。 這項變更會影響 ASP.NET Core 2.2 和 3.0 應用程式,因為跨處理序元件為全域共用。 ASP.NET Core 2.1 應用程式不會受到影響,因為它們預設為使用舊版的 ANCM。

In ASP.NET Core 3.0, the IITS HTTPS case has been enhanced . Through enhanced functionality, the application can explore the server's HTTPS connection port and make it work as expected. The processing sequence feature completes the connection. This function will affect only the ASP.NET Core 3.0 application because the processing sequencer library is configured over the frame. The trans-processive element has changed to self-motivating additional environmental variables. This change will affect the ASP.NET Core 2.2 and 3.0 applications because they are shared across process sequences.

上述行為已於 ASP.NET Core 3.0.1 和 3.1.0 預覽版 3 中修改,以反轉 ASP.NET Core 2.x 中的行為變更。 這些變更只會影響 IIS 跨處理序應用程式。

The above-mentioned behaviour has been modified in ASP.NET Core 3.1.1 and 3.1.0 preview 3 to reverse the behavioral changes in ASP.NET Core 2.x. These changes affect only IIS trans-processor applications.

如上所述,安裝 ASP.NET Core 3.0.0,會產生同時在 ASP.NET Core 2.x 應用程式中啟用 中介軟體的副作用。 ANCM 已在 ASP.NET Core 3.0.1 和 3.1.0 預覽版 3 中變更,這樣一來,兩者的安裝就不會對 ASP.NET Core 2.x 應用程式造成此影響。 ANCM 在 ASP.NET Core 3.0.0 中植入的 環境變數已在 ASP.NET Core 3.0.1 和 3.1.0 預覽版 3 中變更為 。 也在這些版本中更新,以了解新變數和舊變數。 ASP.NET Core 2.x 將不會更新。 因此,這會還原為預設停用的先前行為。

As mentioned above, the installation of ASP.NET Core 3.0.0 produces side effects that will also activate the intermediary software in ASP.NET Core 2.x applications. ANCM has changed in ASP.NET Core 3.1.1 and 3.1.0, preview 3 so that the installation of both will not affect the ASP.NET Core 2.x application. The environmental variables installed in ASP.NET Core 3.0.0 have changed in ASP.NET Core 3.1.1 and 3.1.0 preview 3. It will also be updated in these versions to understand new and old variables. ASP.NETCore 2.x will not be updated.

變更原因

已改善 ASP.NET Core 3.0 功能。

The ASP.NET Core 3.0 functionality has been improved.

如果您希望所有用戶端都使用 HTTPS,則不需要採取任何動作。 若要允許某些用戶端使用 HTTP,請採取下列其中一項步驟:

If you want all users to use HTTPS, you do not need to take any action. To allow some users to use HTTP, take one of the following steps:

  • 從專案的 方法中移除對 和 的呼叫,然後重新部署應用程式。

    Removes the call to the sum from the project method and redeploys the application.

  • web.config 檔案中,將 環境變數設定為空字串。 這項變更可以在伺服器上直接發生,而不需重新部署應用程式。 例如:

    Set environmental variables to empty string in web.config files. This change can occur directly on the server without redeploying the application. For example:

    
    

仍然可以:

Still can:

  • 在 ASP.NET Core 2.x 中手動啟動,方法為將 環境變數設為適當的連接埠號碼 (在大部分的實際執行案例中為 443)。
  • 在 ASP.NET Core 3.x 中停用,方法為使用空字串值來定義 。 這個值設定的方式與上述 範例相同。

執行 ASP.NET Core 3.0.0 應用程式的機器應先安裝 ASP.NET Core 3.0.1 執行階段,再安裝 ASP.NET Core 3.1.0 預覽版 3 ANCM。 這麼做可確保 ASP.NET Core 3.0 應用程式的 繼續如預期運作。

The machine that executes the ASP.NET Core 3.0.0 application should install the ASP.NET Core 3.1 stage before installing the ASP.NET Core 3.1.0 preview version 3 ANCM. This ensures that the ASP.NET Core 3.0 application continues as intended.

在 Azure App Service 中,ANCM 會根據執行階段的全域本質,以個別排程進行部署。 在部署 ASP.NET Core 3.0.1 和 3.1.0 之後,ANCM 會連同這些變更部署至 Azure。

In Azure App Service, ANCM will deploy according to the global nature of the stage. After the deployment of ASP.NET Core 3.1.1 and 3.1.0, ANCM will deploy to Azure in conjunction with these changes.

類別

ASP.NET Core

受影響的 API

HttpsPolicyBuilderExtensions.UseHttpsRedirection(IApplicationBuilder)


引進新的型別來取代現有的 和 型別。

Introduce new types to replace existing ones.

導入的版本

3.0

舊的行為

和 之間有兩種不同的 和 型別。

There are two different and different types between them.

新的行為

舊型別已標示為淘汰,並以新型別取代。

The old variant has been marked as a phase-out and replaced by a new one.

變更原因

在 ASP.NET Core 2.1 中導入 時,部分類型 (例如 和 ) 是從 複製的。 某些 ASP.NET Core 3.0 變更會導致應用程式同時包含 和 命名空間。 參考這兩個命名空間時,只要使用這些重複的型別就會造成「不明確的參考」編譯器錯誤。

Some types (e. g. and) are copied when introduced in ASP.NET Core 2.1. Some ASP.NET Core 3.0 changes will result in applications containing and naming spaces at the same time. When looking at these two named spaces, using these duplicates will cause errors in the "undefined reference" compiler.

以新導入的型別取代任何出現的舊型別,如下所示:

Replace any old differences that appear with a new type of orientation, as follows:

淘汰的型別 (警告):

type of phaseout (warning):

新型別:

New Differential:

新的 和 擴充方法位於 命名空間中。 該命名空間可能需要新增至您的專案。

New and extended methods are located in namespace. This namespace may need to be added to your project.

類別

ASP.NET Core

受影響的 API


為了提高 ASP.NET Core 的隨用隨付效率, 已從主要相依性集合中移除。 現在會自行新增依賴 的特定元件。

In order to increase the use-as-you-go efficiency of ASP.NET Core, it has been removed from the primary dependencies pool.

若要了解相關討論,請參閱 dotnet/aspnetcore#5944

For more information on the discussion, please visit dotnet/aspnetcore#5944.

導入的版本

3.0

舊的行為

預設會在 DI 容器中提供 。

The default will be supplied in the DI container.

新的行為

依預設, 不再於 DI 容器中提供 。

By default, it is no longer available in DI packagings.

變更原因

這項變更可提高 ASP.NET Core 的隨用隨付效率。

This change enhances the efficiency of ASP.NET Core's follow-on use.

如果您的元件需要 ,則必須透過 新增至相依性。

If you need a widget, you have to increase it to depend on it.

類別

ASP.NET Core

受影響的 API

None


為了改善 ASP.NET Core 3.0 效能,已移除 的擴充性。 類別現在是 。 如需詳細資訊,請參閱 dotnet/aspnetcore#6504

To improve the ASP.NET Core 3.0 efficiency, removed extenuity. The category is now available. See dotnet/aspnetcore#6504 for details.

如果您的單元測試使用 ,請改用 或 。

Replace or if your unit test is used.

若要了解相關討論,請參閱 dotnet/aspnetcore#6534

For more information on the discussion, please visit dotnet/aspnetcore#6534.

導入的版本

3.0

舊的行為

類別可以衍生自 。

Classes can be derived from.

新的行為

類別不能衍生自 。

Classes cannot be derived from.

變更原因

一開始會提供擴充性以允許 共用,但這會造成不必要的複雜性,且阻礙了其他最佳化。

In the first place, expansion is provided to allow sharing, but it creates unnecessary complications and hinders other best practices.

如果您在單元測試中使用 ,請改為使用 。

Change it to use if you are using it in the unit test.

類別

ASP.NET Core

受影響的 API

Microsoft.AspNetCore.Http.DefaultHttpContext


從 ASP.NET Core 3.0 預覽版 5 開始,Microsoft.Net.Http.Headers.HeaderNames 中的欄位已從 變更為 。

Starting with ASP.NET Core 3.0, preview version 5, the column in

若要了解相關討論,請參閱 dotnet/aspnetcore#9514

For more information on the discussion, please visit dotnet/aspnetcore#9514.

導入的版本

3.0

舊的行為

這些欄位曾經是 。

These fields used to be.

新的行為

這些欄位現在是 。

These fields are now available.

變更原因

變更:

Change:

  • 防止值跨組件界限內嵌,允許視需要更正值。
  • 啟用更快速的參考相等檢查。

重新編譯 3.0。 以下列方式使用這些欄位的原始程式碼將無法再這麼做:

Recompose 3.0. The original code for these fields will no longer be available as follows:

  • 作為屬性引數
  • 作為 陳述式中的
  • 定義另一個 時

為了因應中斷性變更,請切換使用自我定義的標頭名稱常數或字串常值。

Use a self-defined header name constant or string constant to respond to a breakout change.

類別

ASP.NET Core

受影響的 API

Microsoft.Net.Http.Headers.HeaderNames


支援 HTTP 回應本文的基礎結構已變更。 如果您直接使用 ,就不需要進行任何程式碼變更。 如果您要包裝或取代 ,抑或是或存取 ,請繼續閱讀。

The base structure that supports the HTTP response to this text has changed. If you use it directly, no code changes are required. If you want to wrap or replace it, or if you want to read it again.

導入的版本

3.0

舊的行為

有三個 API 與 HTTP 回應本文相關聯:

There are three APIs associated with HTTP responses:

新的行為

如果您取代 ,這會使用 來提供所有預期 API 的預設實作,將整個 取代為指定資料流周圍的包裝函式。 設定回原始資料流會還原這項變更。

If you replace it, this will be used to provide all defaults for the expected API, replacing the whole package function with the specified data flow. Set back the original data stream to restore this change.

變更原因

動機是將回應本文 API 結合成單一新功能介面。

Motivated to synthesize responses to API with a single new feature interface.

在您先前使用 、 或 的位置使用 。

Use in your previous position.

類別

ASP.NET Core

受影響的 API


是 Cookie 的選項,可協助減輕某些跨網站偽造要求 (CSRF) 攻擊。 一開始導入此選項時,各種 ASP.NET Core API 上使用的預設值並不一致。 不一致導致結果混淆。 自 ASP.NET Core 3.0 起,這些預設值的一致性已提高。 您必須根據每個元件選擇是否加入這項功能。

It is Cookie's option to help mitigate some of the trans-site counterfeiting requirements (CSRF) attacks. The default values used on ASP.NET Core API were not identical at the beginning of the selection. Inconsistencies lead to confusion of results. The consistency of these defaults has improved since ASP.NET Core 3.0. You must select whether to add this function according to each component.

導入的版本

3.0

舊的行為

類似的 ASP.NET Core API 使用不同的預設 SameSiteMode 值。 在 和 中看到不一致的範例,分別預設為 和 。

ASP.NET Core API uses different defaults

新的行為

所有受影響的 API 預設為 。

All affected API defaults are.

變更原因

預設值已變更,使 成為選擇加入的功能。

The default value has been changed so that it becomes an added function.

發出 Cookie 的每個元件都必須決定 是否適合其案例。 檢閱您受影響的 API 使用方式,並視需要重新設定 。

Each component of Cookie's release must decide if it is suitable for its case. View your affected API usage and reset as necessary.

類別

ASP.NET Core

受影響的 API


從 ASP.NET Core 3.0 開始,依預設會停用同步伺服器作業。

Starting with ASP.NET Core 3.0, the synchronised server will be discontinued by default.

變更描述

是每個伺服器中的選項,可啟用或停用同步 IO API,例如 、 和 。 這些 API 長久以來都是執行緒耗盡和應用程式停止回應的來源。 從 ASP.NET Core 3.0 預覽版 3 開始,這些同步作業預設為停用。

is the option in each server to enable or disable synchronizing IO APIs, e. g., and. These APIs have long been the source for running out of energy and applications to stop responding. Starting with ASP.NET Core preview version 3, these synchronization presets are disabled.

受影響的伺服器:

_Other Organiser

  • Kestrel
  • HttpSys
  • IIS 同處理序
  • TestServer

預期發生類似下方的錯誤:

An error similar to the one below is expected:

每部伺服器都有一個 選項可控制此行為,而且所有伺服器的預設值現在是 。

Each server has an option to control the process and the default values for all servers are now available.

行為也可以根據每個要求進行複寫,以作為暫時性風險降低措施。 例如:

Deactivities can also be copied according to each request as a temporary risk reduction measure, for example:


如果您在 中使用 或另一個串流呼叫同步 API 時發生問題,請改為呼叫新的 API。

Call a new API if you have an API problem while using or using another stream to sync with API.

若要了解相關討論,請參閱 dotnet/aspnetcore#7644

For more information on the discussion, please visit dotnet/aspnetcore#7644.

導入的版本

3.0

舊的行為

根據預設,可以使用 、 和 。

By default, you can use, and.

新的行為

預設不允許這些同步 API:

Predict that these syncs are not allowed API:

預期發生類似下方的錯誤:

An error similar to the one below is expected:

變更原因

這些同步 API 長久以來都是執行緒耗盡和應用程式停止回應的來源。 從 ASP.NET Core 3.0 預覽版 3 開始,同步作業預設為停用。

These Synchronization APIs have been the source for running out of energy and applications to stop responding. Synchronization defaults are disabled starting with ASP.NET Core preview version 3.

使用方法的非同步版本。 行為也可以根據每個要求進行複寫,以作為暫時性風險降低措施。

Use a non-sync version of the method. Behavior can also be copied according to each request as a temporary risk reduction measure.


類別

ASP.NET Core

受影響的 API


從 ASP.NET Core 3.0 開始,IdentityBuilderUIExtensions.AddDefaultUI(IdentityBuilder,UIFramework) 方法多載已不存在。

Starting with ASP.NET Core 3.0,

導入的版本

3.0

變更原因

這項變更是採用靜態 Web 資產功能的結果。

This change is the result of the application of the static Web asset function.

呼叫 IdentityBuilderUIExtensions.AddDefaultUI(IdentityBuilder),而不是採用兩個引數的多載。 如果您使用 Bootstrap 3,也請將下列這一行新增至專案檔中的 元素:

IdentityUIExextens. AddDefaultUI (IDentityBuilder) , instead of using two quotations.


類別

ASP.NET Core

受影響的 API

IdentityBuilderUIExtensions.AddDefaultUI(IdentityBuilder,UIFramework)


從 ASP.NET Core 3.0 開始,身分識別 UI 預設為使用第 4 版的 Bootstrap。

Starting with ASP.NET Core 3.0, identity recognition UI is defaulted to use Bootstrap version 4.

導入的版本

3.0

舊的行為

方法呼叫之前與 相同

Same method before calling

新的行為

方法呼叫現在與 相同

Method Call Now Same

變更原因

Bootstrap 4 是在 ASP.NET Core 3.0 時間範圍內發行的。

Bootstrap 4 was issued within the ASP.NET Core 3.0 time range.

如果您使用預設的身分識別 UI 並在 中新增它,就會受到此變更的影響,如下列範例所示:

If you use the default identity UI and add it to it, you will be affected by this change, as shown in the following examples:


執行下列其中一項動作:

Runs one of the following actions:

類別

ASP.NET Core

受影響的 API

None


根據預設, 會擲回主體/身分識別的例外狀況,其中 為 。

By default, the exception to the body/ identity will be thrown back.

導入的版本

3.0

舊的行為

接受任何主體/身分識別,包括 是 的身分識別。

Accept any body/identity, including yes identity.

新的行為

根據預設, 會擲回主體/身分識別的例外狀況,其中 為 。 有新的旗標可隱藏此行為,但預設行為已變更。

By default, the main body/ identity exception will be thrown back. There is a new flag to hide the action, but the default action has changed.

變更原因

舊行為有問題,因為根據預設,這些主體會遭到 / 拒絕。

There is a problem with the old behavior because, according to default, these bodies will be rejected.

在 ASP.NET Core 3.0 預覽版 6 中,依預設 上會有一個 旗標為 。 將此旗標設定為 以還原舊行為。

In ASP.NET Core preview version 6, there will be a flag by default. Set this flag to restore the old behavior.

類別

ASP.NET Core

受影響的 API

None


從 ASP.NET Core 3.0 開始,新的 參數已新增至 建構函式。 如需詳細資訊,請參閱 dotnet/aspnetcore#8356

Starting with ASP.NET Core 3.0, new parameters have been added to the construction function. See for details.

導入的版本

3.0

變更原因

變更的動機是為了在身分識別中替新電子郵件/確認流程新增支援。

The change is motivated to add additional support to the new email/authentication process in the identity recognition.

如果手動建構 ,請提供 的實作,或從相依性插入擷取一個實作來提供。

If constructed manually, please provide an implementation, or extract an implementation from a dependencies inserted.

類別

ASP.NET Core

受影響的 API

SignInManager<TUser>


ASP.NET Core 3.0 導入了靜態 Web 資產功能,身分識別 UI 已加以採用。

ASP.NET Core 3.0 has led to the static Web asset function, which has been used by the identity UI.

變更描述

由於身分識別 UI 採用靜態 Web 資產功能:

As a result of identity recognition UI uses the silent Web asset function:

  • 在專案中中使用 屬性以完成架構選擇。
  • Bootstrap 4 是身分識別 UI 的預設 UI 架構。 Bootstrap 3 已結束生命週期,您應該考慮移轉至支援的版本。

導入的版本

3.0

舊的行為

身分識別 UI 的預設 UI 架構之前是 Bootstrap 3。 UI 架構可以使用 中的 方法呼叫參數來設定。

The default UI setup for identity UI was Bootstrap3. The UI setup can be configured by calling parameters using the method.

新的行為

身分識別 UI 的預設 UI 架構是 Bootstrap 4。 UI 架構必須在專案檔中設定,而不是在 方法呼叫中設定。

The default UI setup for identity UI is Bootstrap4. The UI setup must be set in the project file, not in the methodology call.

變更原因

採用靜態 Web 資產功能時,UI 架構設定必須移至 MSBuild。 內嵌架構的決定是一種建置階段決策,而不是執行階段決策。

When adopting a static Web asset function, the UI architecture configuration must be moved to MSBuild. The decision in the embedded architecture is a phase decision, not a session decision.

檢閱您的網站 UI,以確保新的 Bootstrap 4 元件相容。 如有必要,請使用 MSBuild 屬性以還原為 Bootstrap 3。 將屬性新增至專案檔中的 元素:

View your website UI to make sure that the new Bootstrap 4 widget is compatible. If necessary, use the MSBuild attribute to restore it to Bootstrap 3. Newly add the attribute to the project file:


類別

ASP.NET Core

受影響的 API

IdentityBuilderUIExtensions.AddDefaultUI(IdentityBuilder, UIFramework)


將「pubternal」API 移動至 的過程中,已從 Kestrel 中移除 的概念。 連線配接器會取代為連線中介軟體 (類似 ASP.NET Core 管線中的 HTTP 中介軟體,但適用於較低層級的連線)。 HTTPS 和連線記錄已從連接配接器移至連線中介軟體。 這些擴充方法應該會繼續順暢地運作,但實作詳細資料已變更。

The concept of moving the "pubternal" API to a process has been removed from Kestrel. The connection formulation will replace the HTTP intermediary software (like the ASP.NET Core line, but suitable for lower-level connections). The HTTPS and connection logs have moved from the connector to the connection broker software. These extensions should continue to operate smoothly, but details have changed.

如需詳細資訊,請參閱 dotnet/aspnetcore#11412。 若要了解相關討論,請參閱 dotnet/aspnetcore#11475

For more detailed information, please refer to dotnet/aspnetcore#11412. For more information on the discussions, refer to .

導入的版本

3.0

舊的行為

Kestrel 擴充性元件是使用 建立的。

The Kestrel Extended Component is created using.

新的行為

Kestrel 擴充性元件會建立為中介軟體

Kestrel extension elements will be established as an intermediary .

變更原因

這項變更旨在提供更具彈性的擴充性結構。

The change is intended to provide a more resilient and expanded structure.

轉換 的任何實作以使用新的中介軟體模式,如此處所示。

Any implementation to use a new intermediary model, as .

類別

ASP.NET Core

受影響的 API


已移除組件 Microsoft.AspNetCore.Server.Kestrel.Https

.

導入的版本

3.0

變更原因

在 ASP.NET Core 2.1 中, 的內容已移至 Microsoft.AspNetCore.Server.Kestrel.Core。 這項變更是以非中斷的方式使用 屬性來完成。

In ASP.NET Core 2.1, the content has been moved to

  • 參考 2.0 的程式庫應將所有 ASP.NET Core 相依性更新為 2.1 或更新版本。 否則,可能會在載入 ASP.NET Core 3.0 應用程式時中斷。
  • 以 ASP.NET Core 2.1 和更新版本為目標的應用程式和程式庫應移除 NuGet 套件的任何直接參考。

類別

ASP.NET Core

受影響的 API

None


在舊版中,Kestrel 會在要求本文讀取至結尾時,將 HTTP/1.1 區塊化尾端標頭新增至要求標頭集合。 此行為會造成對標頭和尾端之間模棱兩可的疑慮。 決定將尾端移至新的集合。

In the old version, Kestrel will add a new HTTP/ 1.1 block tail header to the request header when it is required to read this text to the end of the page. This act creates ambiguity between the sign and the end. It is decided to move the end to a new collection.

HTTP/2 要求尾端先前在 ASP.NET Core 2.2 中無法使用,但現在也可以在 ASP.NET Core 3.0 的這個新集合中取得了。

HTTP/2 requires that the end end was previously unusable in ASP.NET Core 2.2, but can now also be acquired in this new assembly of ASP.NET Core 3.0.

已新增新的要求擴充方法來存取這些尾端。

New extension requirements have been added to access these tails.

讀取整個要求本文之後,即可使用 HTTP/1.1 尾端。

The end of HTTP/1.1 can be used when you read the entire request.

從用戶端收到 HTTP/2 尾端後,即可使用。 在伺服器至少緩衝處理整個要求本文之前,用戶端不會傳送尾端。 您可能需要讀取要求本文,以釋放緩衝區空間。 如果您將要求本文讀到結尾,則一定可以取得尾端。 尾端會標示本文的結尾。

The end of HTTP/2 is available when received from the client. The end of the request will not be sent by the client until the server at least slows down the entire request. You may need to read the request to release the buffer space. If you will read the end of the request, the end will be obtained. The end of the request will be marked.

導入的版本

3.0

舊的行為

要求尾端標頭會新增至 集合。

Requires the tail header to be added to the assembly.

新的行為

要求尾端標頭 不存在於 集合中。 在 中使用下列擴充方法來存取:

Requires that the tail header does not exist in the collection. The following extension methods are used to access:

  • - 取得要求 "Trailer" 標頭,其中列出在本文之後預期有哪些尾端。
  • - 指出要求是否支援接收尾端標頭。
  • - 判斷要求是否支援尾端,以及是否可供讀取。
  • - 從回應取得所要求的尾端標頭。

變更原因

尾端是 gRPC 等案例中的重要功能。 將尾端合併至要求標頭,會對使用者造成混淆。

The end is an important function in cases like gRPC. Combine the end to the request mark and create confusion for the user.

在 中使用尾端相關擴充方法來存取尾端。

Use end-related extension to access the end.

類別

ASP.NET Core

受影響的 API

HttpRequest.Headers


在離開「pubternal」API 的過程中,Kestrel 傳輸層 API 會公開為 程式庫中的公用介面。

In the process of leaving the "pubternal" API, the Kestrel Transfer Layer API will be made publicly available as a public interface in the library.

導入的版本

3.0

舊的行為

  • 您可以在 程式庫中取得傳輸相關的抽象概念。
  • 屬性可供使用。

新的行為

  • 程式庫中引進了 介面,可以公開 程式庫中最常使用的功能。
  • 現在可在傳輸選項中使用 ( 和 )。
  • 無法再使用。

變更原因

ASP.NET Core 3.0 已從「pubternal」API 中移除。

ASP.NET Core 3.0 has been removed from "pubternal" API.

類別

ASP.NET Core

受影響的 API

None


ResourceManagerWithCultureStringLocalizer 類別和 WithCulture 介面成員通常是造成當地語系化使用者覺得混淆不清的來源,特別是在建立自己的 實作時。 這些項目可讓使用者覺得 執行個體是「根據語言,根據資源」而定。 事實上,執行個體應該只能是「根據資源」而定。 搜尋的語言取決於執行時間的 。 為了消除混淆的來源,這些 API 在 ASP.NET Core 3.0 中標示為已淘汰。 API 將在未來的發行版本中移除。

ResourceManagerCulturalString

如需內容,請參閱 dotnet/aspnetcore#3324。 若要了解相關討論,請參閱 dotnet/aspnetcore#7756

For further information, please refer to dotnet/aspnetcore#3324. For more information on the relevant discussions, refer to .

導入的版本

3.0

舊的行為

方法之前未標示為 。

Method has not been marked before.

新的行為

方法現在標示 。

Method is now marked.

變更原因

API 代表不建議的使用案例。 當地語系化的設計有混淆不清的情況。

API represents a usage case that is not recommended. There is confusion in local language-synchronization designs.

建議改用 。 讓文化特性由 設定。 如果沒有這個選項,請建立並使用 ResourceManagerWithCultureStringLocalizer 的複本。

It is recommended that the cultural identity be configured. If this option is not available, create and use a copy of ResourceManagerWithCultureSringLocalizer.

類別

ASP.NET Core

受影響的 API


在 ASP.NET Core 3.0 之前, 的存取修飾詞是 。 在 ASP.NET Core 3.0 中,存取修飾詞已變更為 。

Access modifier before ASP. NET Core 3.0. In ASP. NET Core 3.0, access modifier has been changed.

導入的版本

3.0

變更原因

正在進行下列變更:

The following changes are under way:

  • 強制執行與其他記錄器實作保持一致性,例如 。
  • 減少 API 介面。

使用 AddDebug 擴充方法來啟用偵錯記錄。 就算需要手動註冊服務,DebugLoggerProvider 也依然是 。

Using

類別

ASP.NET Core

受影響的 API


在定址 dotnet/aspnetcore#4849 的過程中,ASP.NET Core MVC 依預設會修剪動作名稱的尾碼 。 從 ASP.NET Core 3.0 開始,這項變更會影響路由和連結產生。

In the process of dotnet/aspnetcore#4849, ASP. NET Core MVC will puncture the name of the action by default. Starting with ASP.NET Core 3.0, this change will affect route and link generation.

導入的版本

3.0

舊的行為

請考量下列 ASP.NET Core MVC 控制器:

Consider the following ASSP.NET Core MVC controllers:


動作可透過 路由傳送。 產生連結需要指定 尾碼。 例如:

Actions can be passed by route. Generating connections requires the specification of tails. For example:


新的行為

在 ASP.NET Core 3.0 中,此動作可透過 路由傳送。 連結產生程式碼應該省略 尾碼。 例如:

In ASP.NET Core 3.0, this action can be passed by route. Link generation code should be omitted. For example:


這項變更不會影響使用 屬性指定的名稱。 在 中將 設定為 ,即可停用新的行為:

This change will not affect the use of the name specified by the attribute. Set it in to disable the new behavior:


變更原因

依照慣例,非同步 .NET 方法會以 作為尾碼。 不過,當方法定義 MVC 動作時,不建議使用 尾碼。

As a rule, the non-sync.NET method will be used as a tail. However, when the MVC action is defined, it is not recommended to use the tail.

如果應用程式相依的 MVC 動作保留了名稱的 尾碼,請選擇下列其中一個風險降低措施:

Select one of the following risk reduction measures if the application-based MVC action retains a name for the tail:

  • 使用 屬性來保留原始名稱。
  • 在 中將 設定為 ,以完全停用重新命名:

類別

ASP.NET Core

受影響的 API

None


已移至 組件。 此型別是用來在 Microsoft.AspNetCore.Mvc.Formatters.Json 中定義。 組件層級 [TypeForwardedTo] 屬性已新增至 ,以解決大部分使用者的這個問題。 使用協力廠商程式庫的應用程式可能會遇到問題。

This is defined in . [TypeForwardedTo]

導入的版本

3.0 預覽版 6

3.0 Preview 6

舊的行為

使用 2.2 型程式庫的應用程式已成功建置。

Applications using the 2.2-type library have been successfully built.

新的行為

使用 2.2 型程式庫的應用程式編譯失敗。 系統會提供含有下列文字變化的錯誤訊息:

Could not close temporary folder: %s


如需這類問題的範例,請參閱 dotnet/aspnetcore#7220

For examples of such questions, please refer to dotnet/aspnetcore#7220.

變更原因

ASP.NET Core 組合的平台層級變更,如 aspnet/Announcements#325 所述。

ASP.NET Core mix of platform layer changes, as described in .

針對 2.2 版編譯的程式庫可能需要重新編譯,才能解決所有取用這的這個問題。 如果受到影響,請連絡程式庫建立者。 要求在以 ASP.NET Core 3.0 為目標的條件下重新編譯程式庫。

The database for version 2.2 may need to be redacted to solve all the problems of accessing it. If it is affected, contact the user of the library.

類別

ASP.NET Core

受影響的 API

Microsoft.AspNetCore.Mvc.JsonResult


在 ASP.NET Core 1.1 中導入了 (MVC 先行編譯工具) 套件,以新增 Razor 檔案 (.cshtml 檔案) 發佈階段編譯的支援。 在 ASP.NET Core 2.1 中導入了 Razor SDK,以擴充先行編譯工具的功能。 Razor SDK 新增了 Razor 檔案建置和發佈階段編譯的支援。 SDK 會在建置階段驗證 .cshtml 檔案的正確性,同時改善應用程式啟動時間。 Razor SDK 預設為開啟,不需要手勢即可開始使用。

In ASP.NET Core 1.1, the package (MVC first-line compiler tool) was introduced to add a new Razor file (.cshtml file) to distribute support for phase compilation. In ASP.NET Core 2.1, Razor SDK to expand the functionality of the pre-editing tool. Razor SDK added support for the creation and dissemination of files.

在 ASP.NET Core 3.0 中,已移除 ASP.NET Core 1.1 版 MVC 先行編譯工具。 舊版套件會繼續在修補程式版本中收到重要的錯誤和安全性修正程式。

In ASP.NET Core 3.0, the ASP.NET Core 1.1 MVC pre-compiler tool has been removed. The old version package will continue to receive important errors and security fixes in the modifier version.

導入的版本

3.0

舊的行為

套件是用來預先編譯 MVC Razor 檢視。

The package is used to pre-compose the MVC Razor view.

新的行為

Razor SDK 原本就支援這項功能。 不再更新 套件。

Razor SDK originally supported this feature. The package is not updated.

變更原因

Razor SDK 提供更多功能,並在建置階段驗證 .cshtml 檔案的正確性。 SDK 也會改善應用程式啟動時間。

Razor SDK provides more functionality and verifies the validity of .cshtml files in the build segment. SDK also improves application start-up time.

若是 ASP.NET Core 2.1 或更新版本的使用者,請更新為使用 Razor SDK 中先行編譯的原生支援。 如果錯誤或遺漏功能導致無法移轉至 Razor SDK,請在 dotnet/aspnetcore 提出問題。

If the user of ASP.NET Core 2.1 or the updated version is the user, update the original support compiled in Razor SDK with Razor SDK. If the error or omission is not possible to transfer to Razor SDK, ask a question at .

類別

ASP.NET Core

受影響的 API

None


在 ASP.NET Core 3.0 中,MVC 中的所有「pubternal」類型都已視情況更新為支援命名空間中的 或 。

In ASP.NET Core 3.0, all "pubternal" types in the MVC have been updated as supported namespaces, as the case may be.

變更描述

在 ASP.NET Core 中,「pubternal」類型會宣告為 ,但位於以 爲尾碼的命名空間中。 雖然這些型別是 ,但沒有支援原則,而且可能會發生中斷性變更。 可惜的是,這些型別經常會被意外使用,導致這些專案出現中斷性變更,並限制維護架構的能力。

In ASP.NET Core, the "pubternal" type is declared, but it is located in a space named after the tail. Although these are, there are no supporting principles, and there is a risk of disruption.

導入的版本

3.0

舊的行為

MVC 中的某些型別是 ,但在 命名空間中。 這些型別沒有支援原則,而且可能會發生中斷性變更。

Some of the types in the MVC are, but in the namespace, there is no supporting principle for these types, and there may be disruptions.

新的行為

所有這類型別都會更新為支援命名空間中的 ,或標示為 。

All these types will be updated to support naming spaces or labeled as.

變更原因

這些「pubternal」類型經常會被意外使用,導致這些專案出現中斷性變更,並限制維護結構的能力。

These "pubternal" types are often inadvertently used, leading to intermittent changes in the project and limiting the ability to maintain the structure.

如果您使用的型別已確實變成 ,而且已移至新的支援命名空間,請更新您的參考以符合新的命名空間。

Update your reference to the new namespace if the type used has indeed become and has been moved to the new Support Name Space.

如果您使用已標示為 的型別,則必須尋找替代項目。 先前的「pubternal」類型從未支援供公用使用。 如果這些命名空間中有特定型別對您的應用程式很重要,請在 dotnet/aspnetcore 提出問題。 可能會考慮讓所要求的型別成為 。

If you use the marked type, you must find an alternative item. The previous "pubternal" type has never been supported for public use. If a particular type is important for your application in these namespaces, please ask at . It may be considered that the requested type should become a problem.

類別

ASP.NET Core

受影響的 API

這項變更包含下列命名空間中的型別:

This change includes the following types of named spaces:


從 ASP.NET Core 3.0 開始,不再提供 套件。

Starting with ASP.NET Core 3.0, the package is no longer available.

變更描述

(WebApiCompatShim) 套件與使用 ASP.NET 4.x Web API 2 的 ASP.NET Core 部分相容,可以簡化將現有 Web API 實作移轉至 ASP.NET Core 的作業。 不過,使用 WebApiCompatShim 的應用程式並不會獲益於最近 ASP.NET Core 版本所提供的 API 相關功能。 這類功能包括改善的 Open API 規格產生、標準化錯誤處理,以及用戶端程式碼產生。 為了在 3.0 中提升 API 工作成效,已移除 WebApiCompatShim。 使用 WebApiCompatShim 的現有應用程式應該移轉至較新的 模型。

The WebApiCompatShim package, however, does not benefit from the API-related functionality provided by the recent ASP.NET Core version. These features include improved Open API rule generation, standardizing error processing, and user code generation. To enhance API performance in 3.0, the WebApiCompatShim application has been removed. The current application using the WebApiCompatShim version should be transferred to a new model.

導入的版本

3.0

變更原因

Web API 相容性填充碼是移轉工具。 會限制使用者存取 ASP.NET Core 中新增的功能。

Web API Compatibility Filling is a migration tool. It limits users'access to the additional functionality in ASP.NET Core.

移除此填充碼的使用,並直接移轉至 ASP.NET Core 本身的類似功能。

Removes the use of this filler and moves directly to ASP.NET Core's own approximation.

類別

ASP.NET Core

受影響的 API

Microsoft.AspNetCore.Mvc.WebApiCompatShim


API 已移除,並以 取代。

API removed and replaced.

若要查看討論內容,請參閱 GitHub 問題 dotnet/aspnetcore#25215 (英文)。

For a discussion, please refer to GitHub (English).

導入的版本

3.0

舊的行為

您可以建立範本引擎,並用來剖析和產生 Razor 檔案的程式碼。

You can create a template engine and use the code to profile and generate Razor files.

新的行為

可以建立並提供與 相同的資訊型別,來剖析和產生 Razor 檔案的程式碼。 也提供額外的設定層級。

You can create and provide the same type of information to parsing and generating the code for the Razor file. Additional configuration levels are also available.

變更原因

過於緊密地結合至現有的實作。 這種緊密結合會導致嘗試正確設定 Razor 剖析/產生管線時發生更多問題。

This tight meeting has led to more problems trying to correct the Razor profile/generation of the pipeline.

使用 取代 。 請思考一下下列範例。

Use replacement. Consider the following examples.

建立及設定 RazorProjectEngine

產生 Razor 檔案的程式碼

類別

ASP.NET Core

受影響的 API


Razor 檢視和 Razor Pages 的執行階段編譯支援已移至不同的套件。

The Razor view and Razor Pages section compilation support have been moved to a different package.

導入的版本

3.0

舊的行為

執行階段編譯可供使用,而不需要額外的套件。

An additional package is not required to perform the stage compilation.

新的行為

此功能已移至 Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation 套件。

This feature has been moved to package.

先前已在 中提供下列 API 來支援執行階段編譯。 API 現在可透過 取得。

The following API has already been provided in support of the implementation phase compilation. API is now available via API.

  • 現在為
  • 現在為

此外, 已移除。 根據預設,參考 套件會啟用檔案變更的重新編譯。

In addition, removed. Reference packages will enable recompiling of file changes according to default.

變更原因

需要這項變更,才能移除 Roslyn 上的 ASP.NET Core 共用架構相依性。

This change is needed to remove the ASP.NET Core shared architecture from Roslyn.

需要執行階段編譯或重新編譯 Razor 檔案的應用程式應該採取下列步驟:

The application that needs to be developing or recompiling the Razor file in a session should take the following steps:

  1. 將參考新增至 套件。

    Adds the reference to the new package.

  2. 更新專案的 方法以包括對 的呼叫。 例如:

    Update project methods to include calls. For example:

    
    

類別

ASP.NET Core

受影響的 API

Microsoft.AspNetCore.Mvc.Razor.RazorViewEngineOptions


用來設定工作階段 Cookie 的淘汰 API 已移除。 如需詳細資訊,請參閱 aspnet/Announcements#257

The API phase-out used to configure the session Cookie has been removed. See aspnet/Annountions#257 for details.

導入的版本

3.0

變更原因

這項變更會強制執行 API 之間的一致性,以設定使用 Cookie 的功能。

This change will enforce consistency between API to configure the use of Cookie.

將已移除 API 的使用移轉至其較新的取代項目。 請考慮 中的下列範例:

Move removed API to its newer replacement. Consider the following examples:


類別

ASP.NET Core

受影響的 API


從 ASP.NET Core 3.0 開始,ASP.NET Core 共用架構 () 只包含 Microsoft 完全開發、支援及可服務的第一方組件。

Starting with ASP.NET Core 3.0, the ASP.NET Core Common Architecture () contains only the fully developed, supportive and serviceable first-party component of Microsoft.

變更描述

請將變更視為重新定義 ASP.NET Core「平台」的界限。共用架構將可由任何人透過 GitHub 利用原始碼重新建置,並讓應用程式繼續享有 .NETCore 共用架構的現有優點。 其中部分優點包括較小的部署大小、集中式修補,以及更快的啟動時間。

Please view this change as a redefinition of the ASP.NET Core "platform" threshold. The common architecture will be , which will be recreated by anyone via GitHub using the original code and allow the application to continue to enjoy the current advantages of the.NETCore common architecture. Some of the advantages include smaller deployments, centralized fixes, and faster start-up times.

在變更過程中,會在 中引進一些值得注意的中斷性變更。

During the change process, some notable break-up changes are introduced.

導入的版本

3.0

舊的行為

專案透過專案檔中的 元素參考 。

Project refers to elements in the project file.

此外, 包含下列子元件:

In addition, contain the following sub-components:

  • Json.NET ()
  • Entity Framework Core (前綴 的組件)
  • Roslyn ()

新的行為

的參考不再需要專案檔中的 元素。 .NET Core SDK 支援名為 的新元素,此元素將汰用 。

The element in the project file is no longer required for reference. The new element called.NET Core SDK support will be used.

如需詳細資訊,請參閱 dotnet/aspnetcore#3612

For more information, please refer to dotnet/aspnetcore#3612.

Entity Framework Core 會以 NuGet 套件出貨。 這項變更將使隨附模型與 .NET 上的所有其他資料存取程式庫保持一致。 讓 Entity Framework Core 能夠以最簡單的方式繼續創新,同時支援各種 .NET 平台。 將 Entity Framework Core 移出共用架構不會影響其身為 Microsoft 開發、支援及可服務程式庫的狀態。 .NET Core 支援原則會繼續將其納入支援範圍。

This change will align the accompanying model with all other data access libraries on the.NET. Allows Entity Framewerk Core to continue in the simplest way, supporting various.NET platforms at the same time. Moving Entity Framewerk Core out of the common setup will not affect its status as a Microsoft development, support and serviceable library. will continue to bring its support around.

Json.NET 和 Entity Framework Core 會繼續使用 ASP.NET Core。 不過,不會將它們納入共用架構之中。

Jason.NET and Entity Framewerk Core will continue to use ASP.NET Core. However, they will not be included in the common structure.

如需詳細資訊,請參閱 JSON 於 .NET Core 3.0 中的未來。 另請參閱已從共用架構中移除的二進位檔完整清單

For more detailed information, please refer to data-linktype="External"JSON in.NET Core 3.0 . See also the complete list of two entry files .

變更原因

這項變更可簡化 的取用,並減少 NuGet 套件與共享架構之間的重複。

This change is easily accessible and reduces the duplication between the NuGet package and the shared architecture.

如需此變更動機的詳細資訊,請參閱此部落格文章

For more detailed information about this change of motivation, please refer to .

從 ASP.NET Core 3.0 開始,專案不再需要以 NuGet 套件形式取用 中的組件。 為了簡化 ASP.NET Core 共用架構的定位和使用,ASP.NET Core 1.0 以來隨附的許多 NuGet 套件都不再產生。 透過使用 至 ,這些套件提供的 API 仍可供應用程式利用。 常見的 API 範例包括 Kestrel、MVC 和 Razor。

Starting with ASP.NET Core 3.0, the project no longer needs to extract the active components in the form of the NuGet package. In order to simplify the positioning and use of the ASP.NET Core common architecture, many NuGet packages attached to ASP.NET Core 1.0 are no longer generated. The API provided by these packages is still available for application applications. The usual API models include Kestrel, MVC and Razor.

這項變更不適用於 ASP.NET Core 2.x 中透過 參考的所有二進位檔。 值得注意的例外狀況包括:

This change is not suitable for all binary files consulted in ASP.NET Core 2.x. The notable exceptions include:

如需詳細資訊,請參閱 停止在 3.0 中產生共用架構組件的套件。 若要了解相關討論,請參閱 dotnet/aspnetcore#3757

For more detailed information, please refer to to stop generating a common builder package in 3.0 . For more information on the discussions, refer to .

類別

ASP.NET Core

受影響的 API


從 ASP.NET Core 3.0 開始,不再產生 中繼套件和相符的 共用架構。 此套件可在 ASP.NET Core 2.2 中取得,並將繼續在 ASP.NET Core 2.1 中接收服務更新。

Starting with ASP.NET Core 3.0, there is no longer a relay package and the corresponding common architecture. This package is available in ASP.NET Core 2.2 and will continue to receive service updates in ASP.NET Core 2.1.

導入的版本

3.0

舊的行為

應用程式可以使用 中繼套件,以 .NET Core 上的 共用架構為目標。

The application can use a relay package with the goal of a common architecture on.NET Core.

新的行為

.NET Core 3.0 不包含 共用架構。

.NET Core 3.0 does not contain a common architecture.

變更原因

中繼套件包含大量的外部相依性。

The relay package contains a large number of external dependencies.

移轉您的專案以使用 架構。 先前在 中提供的元件仍可在 NuGet 上使用。 這些元件現在會隨著您的應用程式部署,而不是包含在共用架構中。

Moves your project to use the frame. The components previously provided in the project are still available on NuGet. They will now be deployed with your application instead of being included in the common setup.

類別

ASP.NET Core

受影響的 API

None


已移除 HandshakeProtocol.SuccessHandshakeData 欄位,並以協助程式方法取代,該方法會產生特定 的成功交握回應。

HandshakeProtocol. AccessHandshakakeData, replaced by an aid program method that produces specific successful responses.

導入的版本

3.0

舊的行為

之前是 欄位。

Before that was the field.

新的行為

已由 方法取代,此方法會依據指定的通訊協定傳回 。

Replaced by the method that will be returned according to the communication protocol specified.

變更原因

其他欄位已新增至交握回應,這些欄位屬於非常數且會依據選取的通訊協定而改變。

Other columns have been added to hold responses , which are in an extraordinary number and will change according to the chosen communication protocol.

無。 此型別並非為了在使用者程式碼中使用而設計。 這是 ,因此可以在 SignalR 伺服器與用戶端之間共用。 以 .NET 撰寫的客戶 SignalR 用戶端也可加以使用。 SignalR 的使用者不應受到這項變更的影響。

None. This is not designed to be used in the user code. This is, therefore, shared between the SignalR server and the client. The SignalR client, written by.NET, can also be used. SignalR's user should not be affected by this change.

類別

ASP.NET Core

受影響的 API

HandshakeProtocol.SuccessHandshakeData


和 方法已從 SignalR API 中移除。 這些方法原本僅供內部使用,但於 ASP.NET Core 2.2 公開。 從 ASP.NET Core 3.0 預覽版 4 開始,將無法使用這些方法。 若要了解相關討論,請參閱 dotnet/aspnetcore#8543

These methods were originally intended for internal use only but were made public by ASP.NET Core 2.2. These methods will not be available starting with ASP.NET Core 3.0 preview 4. For information about the discussions, see dotnet/aspnetcore#8543.

導入的版本

3.0

舊的行為

API 曾可供使用。

API used to be available.

新的行為

已移除 API。

Removed API.

變更原因

這些方法原本僅供內部使用,但於 ASP.NET Core 2.2 公開。

These methods were intended only for internal use but were made public by ASP.NET Core 2.2.

請勿使用這些方法。

Do not use these methods.

類別

ASP.NET Core

受影響的 API


SignalR 的 建構函式已變更為接受選項型別,而不是多個參數,以在未來證明新增選項。 這項變更會將兩個建構函式取代為一個接受選項型別的建構函式。

SignalR’s construction function has been changed to accept the option type instead of multiple parameters to prove additional options in the future. This change will replace two construction functions with a construction function that accepts the option type.

導入的版本

3.0

舊的行為

有兩個建構函式:

There are two construction functions:


新的行為

已移除這兩個建構函式,並以一個建構函式取代:

These two construction functions have been removed and replaced by a construction function:


變更原因

新的建構函式會使用新的 options 物件。 因此,未來可以擴充 的功能,而不需要建立更多建構函式並進行中斷性變更。

The new construction function will use new options objects. As a result, the functionality can be expanded in the future without creating more construction functions and making breakover changes.

不使用下列建構函式:

The following construction functions are not used:


而是使用下列建構函式:

Instead, the following construction functions are used:


類別

ASP.NET Core

受影響的 API


在 ASP.NET Core 3.0 預覽版 7 中,SignalR JavaScript 用戶端套件名稱從 變更為 。 此名稱變更反映出 SignalR 不僅僅在 ASP.NET Core 應用程式中有用的事實,這得益於 Azure SignalR Service。

In ASP.NET Core version 3.0, the name of the SignalR JavaScript client package has been changed from one to another. This name change reflects the fact that SignalR is not only useful in ASP.NET Core applications, which benefits Azure SignalR Service.

若要回應這項變更,請變更 package.json 檔案、 陳述式和 ECMAScript 陳述式中的參考。 在此重新命名過程中,不會有任何 API 變更。

To respond to this change, change the references in package.json files, narratives and ECMAScript statements. There will be no API changes in this renaming process.

若要了解相關討論,請參閱 dotnet/aspnetcore#11637

For more information on the discussion, please visit dotnet/aspnetcore#11637.

導入的版本

3.0

舊的行為

用戶端套件之前名為 。

Name before client package.

新的行為

用戶端套件現在名為 。

The client package is now named.

變更原因

此名稱變更說明了 SignalR 不僅僅在 ASP.NET Core 應用程式中有用而已,這得益於 Azure SignalR Service。

This name has been modified to indicate that SignalR is useful not only in the ASP.NET Core application, but also in the Azure SignalR Service.

切換至新的套件 。

Switch to a new package.

類別

ASP.NET Core

受影響的 API

None


方法 和 以及類別 和 在 ASP.NET Core 3.0 中標示為已淘汰。

The method and category and in ASP.NET Core 3.0 are labeled as obsolete.

導入的版本

3.0

舊的行為

SignalR 中樞路由透過使用 或 進行設定。

SignalR's middle route is set through use or configuration.

新的行為

設定路由的舊方式已經淘汰,並取代為端點路由。

The old method of setting the route has been phased out and replaced with a peer route.

變更原因

中介軟體正在移至新的端點路由系統。 新增中介軟體的舊方式已經淘汰。

Intermediary software is being moved to the new peer router system. The old way to add an intermedial software has been phased out.

將 取代為 :

Replace with:

舊程式碼:

Old code:


新程式碼:

new code:


類別

ASP.NET Core

受影響的 API


自 ASP.NET Core 2.1 起,已不再需要下列 NuGet 套件的內容。 因此,下列套件標示為已淘汰:

Since ASP.NET Core 2.1, the content of the following NuGet package is no longer required. As a result, the following package is labelled obsolete:

基於相同的理由,下列 npm 模組標示為已被取代:

For the same reason, the following npm modules have been labelled as replaced:

上述套件和 npm 模組後續會在 .NET 5 中移除。

The above package and the npm module will be removed in.NET 5.

導入的版本

3.0

舊的行為

被取代的套件和 npm 模組旨在整合 ASP.NET Core 與各種單頁應用程式 (SPA) 架構。 這類架構包括 redux Angular、React 和使用 Redux 的 React。

Replaced packages and npm modules are designed to integrate ASP.NET Core with single page applications (SPAs). These structures include redux Angular, React and Redux React.

新的行為

Microsoft.AspNetCore.SpaServices.Extensions NuGet 套件中有新的整合機制。 自 ASP.NET Core 2.1 起,套件會維持 Angular 和 React 專案範本的基礎。

Microsoft. AspNetCore. SpaServices. Extensions NuGet package has a new integration mechanism. From ASP.NET Core 2.1, the package will maintain the foundation of Angular and React project templates.

變更原因

ASP.NET Core 支援與各種單頁應用程式 (SPA) 架構整合,包括 Angular、React 和使用 Redux 的 React。 一開始,與這些架構的整合透過 ASP.NET Core 特定元件來完成,這些元件可處理伺服器端預先轉譯和整合 Webpack 等案例。 業界標準已隨著時間變更。 每個 SPA 架構都會發行自己的標準命令列介面。 例如,Angular CLI 和 create-react-app。

ASP.NET Core support integrates with single page applications (SPA) structures, including Angular, React and Redux React. At first, integration with these structures is done through ASP.NET Core specific components that handle pre-translation and integration of Webpack cases from server users. The industry criteria have changed over time. Each SPA structure issues its own standard command interfaces. For example, Angular CIA and Create-react-app.

ASP.NET Core 2.1 於 2018 年 5 月發行時,小組回應了標準的變更。 已提供較新且更簡單的方式來整合 SPA 架構本身的工具鏈。 新的整合機制存在於套件 中,並維持自 ASP.NET Core 2.1 以來的 Angular 和 React 專案範本基礎。

ASP.NET Core 2.1 responded to standard changes when it was released in May 2018. Newer and simpler ways to integrate the SPA architecture itself have been provided. The new integration mechanism exists in the package and maintains the bases of the ASP.NET Core 2.1 project templates for Angular and React.

為了表明較舊的 ASP.NET Core 特定元件不相關且不建議使用:

To show that older ASP.NET Core specific widgets are not relevant and are not recommended for use:

  • 2.1 之前的整合機制標示為已淘汰。
  • 支援的 npm 套件標示為已被取代。

如果您使用這些套件,請更新您的應用程式以使用功能:

If you use these packages, update your application to use functionality:

  • 在 套件中。
  • 由您使用的 SPA 架構所提供

若要啟用伺服器端預先呈現和熱模組重載等功能,請參閱對應 SPA 架構的文件。 中的功能尚未淘汰,而且將繼續受到支援。

To enable server-side pre-presentation and heat module reloading, see the document that corresponds to the SPA architecture. The function has not been phased out and will continue to be supported.

類別

ASP.NET Core

受影響的 API


除非已設定記錄,否則 Microsoft.AspNetCore.SpaServicesMicrosoft.AspNetCore.NodeServices 不會顯示主控台記錄。

Unless records are configured, and

導入的版本

3.0

舊的行為

和 用於在未設定記錄時自動建立主控台記錄器。

and to automatically create a master recorder without setting a record.

新的行為

除非已設定記錄,否則 和 不會顯示主控台記錄。

Unless records are configured, and do not show the master control records.

變更原因

需要與其他 ASP.NET Core 套件實作記錄的方式一致。

Need to match the way other ASP.NET Core packages are actually recorded.

如果需要舊的行為,而要設定主控台記錄,請將 新增至您的 方法。

If an old behavior is required, set the master control record, add a new one to your method.

類別

ASP.NET Core

受影響的 API

None


從 ASP.NET Core 3.0 開始,.NET Framework 不再是受支援的目標架構。

Starting with ASP.NET Core 3.0,...NET Framewerk is no longer a supported target structure.

變更描述

.NET Framework 4.8 是 .NET Framework 的最後一個主要版本。 新的 ASP.NET Core 應用程式應建置在 .NET Core 上。 從 .NET Core 3.0 版本開始,您可以將 ASP.NET Core 3.0 視為 .NET Core 的一部分。

.NET Framework 4.8 is the last major version of.NET Framework. The new ASP.NET Core application is built on.NET Core. Starting with.NET Core 3.0, you can consider ASP.NET Core 3.0 as part of.NET Core.

使用 ASP.NET Core 搭配 .NET Framework 的客戶可以使用 2.1 LTS 版本,繼續受到完整支援。 2.1 的支援與服務會持續到至少 2021 年 8 月 21 日為止。 根據 .NET 支援原則,此日期訂為宣告 LTS 版本的三年後。 在 .NET Framework 上對 ASP.NET Core 2.1 套件的支援將無限延伸,類似於其他套件型 ASP.NET 架構的服務原則

2.1 LTS continues to be fully supported. 2.1 Support and services will last until at least 21 August 2021. .NET Support formerly , which is scheduled to announce the LTS version at least three years after 21 August.

如需從 .NET Framework 移植到 .NET Core 的詳細資訊,請參閱移植到 .NET Core

See

套件 (例如記錄、相依性插入和設定) 和 Entity Framework Core 不會受到影響。 它們會繼續支援 .NET Standard。

Packages (e. g. records, dependent insertions and configurations) and Entity Framewerk Core will not be affected. They will continue to support.NET Standard.

如需此變更動機的詳細資訊,請參閱原始部落格文章

For more detailed information about this change of motivation, please refer to .

導入的版本

3.0

舊的行為

ASP.NET Core 應用程式可執行於 .NET Core 或 .NET Framework。

ASP.NET Core application can be executed at.NET Core or.NET Framework.

新的行為

ASP.NET Core 應用程式只能在 .NET Core 上執行。

ASP.NET Core application can only be executed on.NET Core.

執行下列其中一項動作:

Runs one of the following actions:

  • 將您的應用程式保留在 ASP.NET Core 2.1 上。
  • 將您的應用程式和相依性移轉至 .NET Core。

類別

ASP.NET Core

受影響的 API

None


美化布局示例

欧易(OKX)最新版本

【遇到注册下载问题请加文章最下面的客服微信】永久享受返佣20%手续费!

APP下载   全球官网 大陆官网

币安(Binance)最新版本

币安交易所app【遇到注册下载问题请加文章最下面的客服微信】永久享受返佣20%手续费!

APP下载   官网地址

火币HTX最新版本

火币老牌交易所【遇到注册下载问题请加文章最下面的客服微信】永久享受返佣20%手续费!

APP下载   官网地址
文字格式和图片示例

注册有任何问题请添加 微信:MVIP619 拉你进入群

弹窗与图片大小一致 文章转载注明

分享:

扫一扫在手机阅读、分享本文

发表评论
平台列表
美化布局示例

欧易(OKX)

  全球官网 大陆官网

币安(Binance)

  官网

火币(HTX)

  官网

Gate.io

  官网

Bitget

  官网

deepcoin

  官网
热门文章
  • 0.00003374个比特币等于多少人民币/美金

    0.00003374个比特币等于多少人民币/美金
    0.00003374比特币等于多少人民币?根据比特币对人民币的最新汇率,0.00003374比特币等于2.2826 1222美元/16.5261124728人民币。比特币(BTC)美元(USDT)人民币(CNY)0.00003374克洛克-0/22216.5261124728比特币对人民币的最新汇率为:489807.72 CNY(1比特币=489807.72人民币)(1美元=7.24人民币)(0.00003374USDT=0.0002442776 CNY)。汇率更新于2024...
  • 0.00006694个比特币等于多少人民币/美金

    0.00006694个比特币等于多少人民币/美金
    0.00006694比特币等于多少人民币?根据比特币对人民币的最新汇率,0.00006694比特币等于4.53424784美元/32.5436 16人民币。比特币(BTC)美元(USDT)人民币(CNY)0.000066944.53424784【比特币密码】32.82795436 16比特币对人民币的最新汇率为:490408.64 CNY(1比特币=490408.64人民币)(1美元=7.24人民币)(0.00006694USDT=0.0004846456 CNY)汇率更新时...
  • 0.00015693个比特币等于多少人民币/美金

    0.00015693个比特币等于多少人民币/美金
    0.000 15693比特币等于多少人民币?根据比特币对人民币的最新汇率,0.000 15693比特币等于10.6 1678529美元/76.86554996人民币。比特币(BTC)【比特币价格翻倍】美元(USDT)人民币(CNY)0.000/克洛克-0/5693【数字货币矿机】10.6 167852976.8655254996比特币对人民币的最新汇率为:489,807.72 CNY(1比特币= 489,807.72人民币)(1美元=7.24人民币)(0.00015693 U...
  • 币圈院士:5.20比特币(BTC)以太坊(ETH)行情分析

    币圈院士:5.20比特币(BTC)以太坊(ETH)行情分析
    利空出尽?华尔街多头坚信美股将摆脱泥潭 经济衰退风险被夸大A lot of people on Wall Street believe that beauty will escape the quagmire; the risk of recession is exaggerated. 从目前美国经济的情况加上美股先有的走势来判断,确信通胀已经或即将见顶,这为价格压力回落铺平了道路,这最终将使美联储得以放缓...
  • 2000年美国GDP占世界的304%,中国GDP仅占35%,现在呢?

    2000年美国GDP占世界的304%,中国GDP仅占35%,现在呢?
    GDP作为全球公认的实力基准,就像是一个大国实力的代言人,它是布雷顿森林体系下全球团结的声音。它不仅仅是数字的累积,更是大国综合实力的人格化,默默诉说着每个国家的辉煌与荣耀。虽然GDP不是衡量一个国家综合实力的唯一标准,但无疑是最关键的指标之一。作为一面镜子,它反映了国家的经济实力和发展水平,是国家综合实力的重要体现,不容忽视。2000年,中国GDP迈过/克洛克-0/万亿美元的重要门槛,达到/克洛克-0/。2/克洛克-0/万亿美元(折合人民币7。7万亿元)。然而,在全球经济的...
标签列表