將移轉變更從 .NET Framework 4.7 重定為 4.7.1Retargeting Changes for Migration from .NET Framework 4.7 to 4.7.1

如果您想從 .NET Framework 4.7 移轉至 4.7.1,請檢閱下列主題中可能會影響應用程式的應用程式相容性問題:If you are migrating from the .NET Framework 4.7 to 4.7.1, review the following topics for application compatibility issues that may affect your app:

ASP.NETASP.NET

.NET Framework 4.7.1 中的 ASP.NET 協助工具改進功能ASP.NET Accessibility Improvements in .NET Framework 4.7.1

詳細資料Details 從 .NET Framework 4.7.1 開始,ASP.NET 已經改善 ASP.NET Web 控制項如何搭配 Visual Studio 中的協助工具技術,來更妥善支援 ASP.NET 客戶。Starting with the .NET Framework 4.7.1, ASP.NET has improved how ASP.NET Web Controls work with accessibility technology in Visual Studio to better support ASP.NET customers. 這些包括下列變更:These include the following changes:
  • 在控制項中,實作遺漏 UI 協助工具模式的變更,例如在 [詳細資料檢視精靈] 的 [新增欄位] 對話方塊或 ListView 精靈的 [設定 ListView] 對話方塊。Changes to implement missing UI accessibility patterns in controls, like the Add Field dialog in the Details View wizard, or the Configure ListView dialog of the ListView wizard.
  • 改善高對比模式顯示的變更,例如資料頁面巡覽區欄位編輯器。Changes to improve the display in High Contrast mode, like the Data Pager Fields Editor.
  • 改善控制項鍵盤瀏覽體驗的變更,例如 DataPager 控制項 [編輯頁面巡覽區欄位精靈] 的 [欄位] 對話方塊、[設定 ObjectContext] 對話方塊,或是 [設定資料來源精靈] 的 [設定資料選取項目] 對話方塊。Changes to improve the keyboard navigation experiences for controls, like the Fields dialog in the Edit Pager Fields wizard of the DataPager control, the Configure ObjectContext dialog, or the Configure Data Selction dialog of the Configure Data Source wizard.
建議Suggestion 如何選擇加入或退出這些變更How to opt in or out of these changes
為了讓 Visual Studio 設計工具受益于這些變更,它必須在 .NET Framework 4.7.1 或更新版本上執行。In order for the Visual Studio Designer to benefit from these changes, it must run on the .NET Framework 4.7.1 or later. Web 應用程式可以由下列任一種方式受益於這些變更:The web application can benefit from these changes in either of the following ways:
  • 安裝 Visual Studio 2017 15.3 或更新版本中,依預設它會以下列 AppContext 參數支援新的協助工具功能。Install Visual Studio 2017 15.3 or later, which supports the new accessibility features with the following AppContext Switch by default.
  • 藉由將 Switch.UseLegacyAccessibilityFeatures AppContext 參數新增到 devenv.exe.config 檔案中的 <runtime> 區段,並將它設定為 false,選擇退出舊版協助工具行為,如下列範例所示。Opt out of the legacy accessibility behaviors by adding the Switch.UseLegacyAccessibilityFeatures AppContext switch to the <runtime> section in the devenv.exe.config file and setting it to false, as the following example shows.
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<runtime>
...
<!-- AppContextSwitchOverrides value attribute is in the form of 'key1=true/false;key2=true/false'  -->
<AppContextSwitchOverrides value="Switch.UseLegacyAccessibilityFeatures=false" />
...
</runtime>
</configuration>
以 .NET Framework 4.7.1 或更新版本為目標,並且想要保留舊版協助工具行為的應用程式,可以藉由明確將此 AppContext 參數設為 true,選擇使用舊版的協助工具功能。Applications that target the .NET Framework 4.7.1 or later and want to preserve the legacy accessibility behavior can opt in to the use of legacy accessibility features by explicitly setting this AppContext switch to true.
範圍Scope 次要Minor
版本Version 4.7.14.7.1
輸入Type 正在重定目標Retargeting

核心Core

SerialPort 背景執行緒例外狀況SerialPort background thread exceptions

詳細資料Details 使用 SerialPort 資料流建立的背景執行緒與不會再於擲回 OS 的例外狀況時終止處理序。Background threads created with SerialPort streams no longer terminate the process when OS exceptions are thrown.
在以 .NET Framework 4.7 和舊版為目標的應用程式中,當使用 SerialPort 資料流建立的背景執行緒上擲回作業系統例外狀況時,處理程序會終止。In applications that target the .NET Framework 4.7 and earlier versions, a process is terminated when an operating system exception is thrown on a background thread created with a SerialPort stream.
在目標為 .NET Framework 4.7.1 或更新版本的應用程式中,背景執行緒會等候與作用中的序列連接埠相關且在某些情況下可能會損毀的 OS 事件,例如突然移除序列連接埠。In applications that target the .NET Framework 4.7.1 or a later version, background threads wait for OS events related to the active serial port and could crash in some cases, such as sudden removal of the serial port.
建議Suggestion 若為以 .NET Framework 4.7.1 為目標的應用程式,如果不需要例外狀況處理,您可以透過將下列內容新增至 app.config 檔案的 <runtime> 區段以選擇退出例外狀況處理︰For apps that target the .NET Framework 4.7.1, you can opt out of the exception handling if it is not desirable by adding the following to the <runtime> section of your app.config file:
<runtime>
<AppContextSwitchOverrides value="Switch.System.IO.Ports.DoNotCatchSerialStreamThreadExceptions=true" />
</runtime>
若為以舊版 .NET Framework 為目標但卻在 .NET Framework 4.7.1 或更新版本上執行的應用程式,則可將下列內容新增至 app.config 檔案的 <runtime> 區段,以選擇加入例外狀況處理:For apps that target earlier versions of the .NET Framework but run on the .NET Framework 4.7.1 or later, you can opt in to the exception handling by adding the following to the <runtime> section of your app.config file:
<runtime>
<AppContextSwitchOverrides value="Switch.System.IO.Ports.DoNotCatchSerialStreamThreadExceptions=false" />
</runtime>
範圍Scope 次要Minor
版本Version 4.7.14.7.1
類型Type 正在重定目標Retargeting
受影響的 APIAffected APIs

ServiceBase 不會傳播 OnStart 例外狀況ServiceBase doesn't propagate OnStart exceptions

詳細資料Details 在 .NET Framework 4.7 和更早版本中,在服務啟動時擲回的例外狀況不會傳播至 ServiceBase.Run 的呼叫端。In the .NET Framework 4.7 and earlier versions, exceptions thrown on service startup are not propagated to the caller of ServiceBase.Run.
從 .NET Framework 4.7.1 為目標的應用程式開始,執行階段會為無法啟動的服務將例外狀況傳播到 ServiceBase.RunStarting with applications that target the .NET Framework 4.7.1, the runtime propagates exceptions to ServiceBase.Run for services that fail to start.
建議Suggestion 在服務啟動時,如果有例外狀況,將會傳播該例外狀況。On service start, if there is an exception, that exception will be propagated. 這應該有利於診斷服務無法啟動的情況。This should help diagnose cases where services fail to start.
如果不需要此行為,您可以在應用程式組態檔的 <runtime> 區段中新增以下 <AppContextSwitchOverrides> 元素,以選擇退出:If this behavior is undesirable, you can opt out of it by adding the following <AppContextSwitchOverrides> element to the <runtime> section of your application configuration file:
<AppContextSwitchOverrides value="Switch.System.ServiceProcess.DontThrowExceptionsOnStart=true" />
如果您的應用程式以比 4.7.1 舊的版本為目標,但您想要有這種行為,請在應用程式設定檔的 <runtime> 區段中新增以下 <AppContextSwitchOverrides> 元素:If your application targets an earlier version than 4.7.1 but you want to have this behavior, add the following <AppContextSwitchOverrides> element to the <runtime> section of your application configuration file:
<AppContextSwitchOverrides value="Switch.System.ServiceProcess.DontThrowExceptionsOnStart=false" />
範圍Scope 次要Minor
版本Version 4.7.14.7.1
類型Type 正在重定目標Retargeting
受影響的 APIAffected APIs

安全性Security

預設 SignedXML 和 SignedXMS 演算法變更為 SHA256Default SignedXML and SignedXMS algorithms changed to SHA256

詳細資料Details 在 .NET Framework 4.7 和更早版本中,某些作業的 SignedXML 和 SignedCMS 預設為 SHA1。從 .NET Framework 4.7.1 開始,針對這些作業預設會啟用 SHA256。In the .NET Framework 4.7 and earlier, SignedXML and SignedCMS default to SHA1 for some operations.Starting with the .NET Framework 4.7.1, SHA256 is enabled by default for these operations. 這項變更是必要的,因為 SHA1 不再被視為是安全的方法。This change is necessary because SHA1 is no longer considered to be secure.
建議Suggestion 有兩個新內容參數值可以控制預設使用 SHA1 (不安全) 還是 SHA256:There are two new context switch values to control whether SHA1 (insecure) or SHA256 is used by default:
  • Switch.System.Security.Cryptography.Xml.UseInsecureHashAlgorithmsSwitch.System.Security.Cryptography.Xml.UseInsecureHashAlgorithms
  • Switch.System.Security.Cryptography.Pkcs.UseInsecureHashAlgorithmsSwitch.System.Security.Cryptography.Pkcs.UseInsecureHashAlgorithms
若為以 .NET Framework 4.7.1 和更新版本為目標的應用程式,如果使用 SHA256 不適當,您可以將預設值還原為 SHA1 ,方法是新增下列設定參數到應用程式設定檔的 runtime 區段:For applications that target the .NET Framework 4.7.1 and later versions, if the use of SHA256 is undesirable, you can restore the default to SHA1 by adding the following configuration switch to the runtime section of your app config file:
<AppContextSwitchOverrides value="Switch.System.Security.Cryptography.Xml.UseInsecureHashAlgorithms=true;Switch.System.Security.Cryptography.Pkcs.UseInsecureHashAlgorithms=true" />
若為以 .NET Framework 4.7.1 和更早版本為目標的應用程式,您可以新增下列設定參數到應用程式設定檔的 runtime 區段,選擇加入此變更:For applications that target the .NET Framework 4.7 and earlier versions, you can opt into this change by adding the following configuration switch to the runtime section of your app config file:
<AppContextSwitchOverrides value="Switch.System.Security.Cryptography.Xml.UseInsecureHashAlgorithms=false;Switch.System.Security.Cryptography.Pkcs.UseInsecureHashAlgorithms=false" />
範圍Scope 次要Minor
版本Version 4.7.14.7.1
類型Type 正在重定目標Retargeting
受影響的 APIAffected APIs

SignedXml.GetPublicKey RSACng 會在 net462 (或 lightup) 上傳回 RSACng,而無重定目標變更SignedXml.GetPublicKey returns RSACng on net462 (or lightup) without retargeting change

詳細資料Details 從 .NET Framework 4.6.2 開始,SignedXml.GetPublicKey 方法所傳回的物件具象類型 (毫不奇怪地) 從 CryptoServiceProvider 實作變更為 Cng 實作。Starting with the .NET Framework 4.6.2, the concrete type of the object returned by the SignedXml.GetPublicKey method changed (without a quirk) from a CryptoServiceProvider implementation to a Cng implementation. 這是因為實作從使用 certificate.PublicKey.Key 變更為使用內部 certificate.GetAnyPublicKey,它會轉送給 RSACertificateExtensions.GetRSAPublicKeyThis is because the implementation changed from using certificate.PublicKey.Key to using the internal certificate.GetAnyPublicKey which forwards to RSACertificateExtensions.GetRSAPublicKey.
建議Suggestion 從在 .NET Framework 4.7.1 上執行的應用程式開始,您可以使用 .NET Framework 4.6.1 和更早版本中預設使用的 CryptoServiceProvider 實作,方法是將下列設定參數新增至您應用程式設定檔的 runtime 區段:Starting with apps running on the .NET Framework 4.7.1, you can use the CryptoServiceProvider implementation used by default in the .NET Framework 4.6.1 and earlier versions by adding the following configuration switch to the runtime section of your app config file:
<AppContextSwitchOverrides value="Switch.System.Security.Cryptography.Xml.SignedXmlUseLegacyCertificatePrivateKey=true" />
範圍Scope EdgeEdge
版本Version 4.6.24.6.2
類型Type 正在重定目標Retargeting
受影響的 APIAffected APIs

Windows Communication Foundation (WCF)Windows Communication Foundation (WCF)

某些 .NET SDK 工具之改善的協助工具Improved accessibility for some .NET SDK tools

詳細資料Details 在 .NET Framework SDK 4.7.1 中,SvcConfigEditor.exe 和 SvcTraceViewer.exe 工具已透過修正不同的協助工具問題而得到改善。In the .NET Framework SDK 4.7.1, the SvcConfigEditor.exe and SvcTraceViewer.exe tools have been improved by fixing varied accessibility issues. 其中大部分是小問題,例如未定義名稱,或未正確實作某些 UI 自動化模式。Most of these were small issues like a name not being defined or certain UI automation patterns not being implemented correctly. 雖然許多使用者並未注意到這些不正確的值,但使用螢幕助讀程式等輔助技術的客戶會發現這些 SDK 工具更易於存取。While many users wouldn’t be aware of these incorrect values, customers who use assistive technologies like screen readers will find these SDK tools more accessible. 當然,這些修正程式會變更一些先前的行為,例如鍵盤焦點順序。為了取得這些工具的所有協助工具修正程式,您可以將下列程式碼新增至 app.config 檔案:Certainly, these fixes change some previous behaviors, like keyboard focus order.In order to get all the accessibility fixes in these tools, you can the following to your app.config file:
<runtime>
<AppContextSwitchOverrides value="Switch.UseLegacyAccessibilityFeatures=false"/>
</runtime>
範圍Scope EdgeEdge
版本Version 4.7.14.7.1
類型Type 正在重定目標Retargeting

Windows FormsWindows Forms

Windows Forms 控制項的協助工具改善Accessibility improvements in Windows Forms controls

詳細資料Details Windows Forms 正在使用協助工具技術改善其運作方式,以便為 Windows Forms 客戶提供更好的支援。Windows Forms is improving how it works with accessibility technologies to better support Windows Forms customers. 包括自 .NET Framework 4.7.1 開始的下列變更:These include the following changes starting with the .NET Framework 4.7.1:
  • 改善高對比模式期間之顯示方式的變更。Changes to improve display during High Contrast mode.
  • 改善屬性瀏覽器體驗的變更。Changes to improve the property browser experience. 屬性瀏覽器改善包括:Property browser improvements include:
  • 透過各種下拉式選取視窗進行更佳的鍵盤導覽。Better keyboard navigation through the various drop-down selection windows.
  • 減少不必要的定位停駐點。Reduced unnecessary tab stops.
  • 更適當地報告控制項類型。Better reporting of control types.
  • 改善的朗讀程式行為。Improved narrator behavior.
  • 在控制項中實作遺漏的 UI 協助工具模式的變更。Changes to implement missing UI accessibility patterns in controls.
建議Suggestion 如何選擇加入或退出這些變更How to opt in or out of these changes
為了讓應用程式可受益於這些變更,它必須在 .NET Framework 4.7.1 或更新版本上執行。In order for the application to benefit from these changes, it must run on the .NET Framework 4.7.1 or later. 應用程式可以用下列任一種方式受益於這些變更:The application can benefit from these changes in either of the following ways:
  • 它已重新編譯為以 .NET Framework 4.7.1 為目標。It is recompiled to target the .NET Framework 4.7.1. 在以 .NET Framework 4.7.1 或更新版本為目標的 Windows Forms 應用程式上,預設會啟用這些協助工具變更。These accessibility changes are enabled by default on Windows Forms applications that target the .NET Framework 4.7.1 or later.
  • 藉由在 app config 檔案的 <runtime> 區段中新增下列 AppContext 參數,並將它設定為 false,選擇退出舊版協助工具行為,如下列範例所示。It opts out of the legacy accessibility behaviors by adding the following AppContext switch to the <runtime> section of the app.config file and setting it to false, as the following example shows.
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7"/>
</startup>
<runtime>
<!-- AppContextSwitchOverrides value attribute is in the form of 'key1=true/false;key2=true/false  -->
<AppContextSwitchOverrides value="Switch.UseLegacyAccessibilityFeatures=false" />
</runtime>
</configuration>

以 .NET Framework 4.7.1 或更新版本為目標,並且想要保留舊版協助工具行為的應用程式,可以藉由明確將此 AppContext 參數設為 true,選擇使用舊版的協助工具功能。Applications that target the .NET Framework 4.7.1 or later and want to preserve the legacy accessibility behavior can opt in to the use of legacy accessibility features by explicitly setting this AppContext switch to true.

如需 UI 自動化的概觀,請參閱 UI 自動化概觀For an overview of UI automation, see the UI Automation Overview.

為 UI 自動化模式和屬性新增的支援Added support for UI Automation patterns and properties
協助工具用戶端可以使用通用的公開描述叫用模式,利用新的 WinForms 協助工具功能。Accessibility clients can take advantage of new WinForms accessibility functionality by using common, publicly described invocation patterns. 這些不是 WinForms 特有模式。These patterns are not WinForms-specific. 例如,協助工具用戶端可以在 IAccessible 介面 (MAAS) 上呼叫 QueryInterface 方法,以取得 IServiceProvider 介面。For instance, accessibility clients can call the QueryInterface method on the IAccessible interface (MAAS) to obtain an IServiceProvider interface. 如果此介面可供使用,用戶端可以使用其 QueryService 方法來要求 IAccessibleEx 介面。If this interface is available, clients can use its QueryService method to request an IAccessibleEx interface. 如需詳細資訊,請參閱從用戶端使用 IAccessibleExFor more information, see Using IAccessibleEx from a Client. 從 .NET Framework 4.7.1 開始,IServiceProvider 和 IAccessibleEx (若適用) 可供 WinForms 協助工具物件使用。Starting with the .NET Framework 4.7.1, IServiceProvider and IAccessibleEx (where applicable) are available for WinForms accessibility objects.

.NET Framework 4.7.1 為下列 UI 自動化模式和屬性新增支援:The .NET Framework 4.7.1 adds support for the following UI automation patterns and properties:

PropertyGrid 控制項的改善Improvements to the PropertyGrid control
.NET Framework 4.7.1 在 PropertyBrowser 控制項中新增下列改善:The .NET Framework 4.7.1 adds the following improvements to the PropertyBrowser control:
  • 使用者在 PropertyGrid 控制項中輸入不正確的值時所顯示之 [錯誤] 對話方塊中的 [詳細資料] 按鈕,支援展開/摺疊模式、狀態與名稱變更通知,以及值為 ControlType.MenuItemControlType 屬性。The Details button in the error dialog that is displayed when the user enters an incorrect value in the PropertyGrid control supports the Expand/Collapse pattern, state and name change notifications, and a ControlType property with a value of ControlType.MenuItem.
  • 展開 [錯誤] 對話方塊的 [詳細資料] 按鈕時所顯示的 [訊息] 窗格,現在可透過鍵盤存取,並可讓朗讀程式宣告錯誤訊息的內容。The message pane displayed when the Details button of the error dialog is expanded is now keyboard accessible and allows Narrator to announce the content of the error message.
  • PropertyGrid 控制項中資料列的 AccessibleRole 已從 "Row" 變更為 "Cell"。The AccessibleRole of rows in the PropertyGrid control have changed from "Row" to "Cell". 此資料格會對應至 UIA ControlType "DataItem",讓它支援適當的鍵盤快速鍵和朗讀程式宣告。The cell maps to UIA ControlType "DataItem", which allows it to support appropriate keyboard shortcuts and Narrator announcements.
  • PropertyGrid 控制項將 PropertySort 屬性設定為 PropertySort.Categorized 時代表標頭項目的 PropertyGrid 控制項資料列,具有 ControlType 屬性值 ControlType.ButtonThe PropertyGrid control rows that represent header items when the PropertyGrid control has a PropertySort property set to PropertySort.Categorized have a ControlType property value of ControlType.Button.
  • PropertyGrid 控制項將 PropertySort 屬性設定為 PropertySort.Categorized 時代表標頭項目的 PropertyGrid 控制項資料列,支援展開/摺疊模式The PropertyGrid control rows that represent header items when the PropertyGrid control has a PropertySort property set to PropertySort.Categorized support the Expand/Collapse pattern.
  • 改善了方格與其上工具列之間的鍵盤導覽。Improved keyboard navigation between the grid and the ToolBar above it. 按下 "Shift-Tab" 現在會選取第一個工具列按鈕,而不是整個工具列。Pressing "Shift-Tab" now selects the first ToolBar button, instead of the whole ToolBar.
  • 在高對比模式中顯示的 PropertyGrid 控制項,現在會圍繞對應於目前 PropertySort 屬性值的工具列按鈕繪製焦點矩形。PropertyGrid controls displayed in High Contrast mode will now draw a focus rectangle around the ToolBar button which corresponds to the current PropertySort property value.
  • 在高對比模式中顯示且 PropertySort 屬性設定為 PropertySort.CategorizedPropertyGrid 控制項,現在將以高對比的色彩顯示分類標頭的背景。PropertyGrid controls displayed in High Contrast mode and with a PropertySort property set to PropertySort.Categorized will now display the background of category headers in a highly contrasting color.
  • PropertyGrid 控制項可以更好地區別具有焦點的工具列項目與表示 PropertySort 屬性目前值的工具列項目。PropertyGrid controls better differentiates between ToolBar items with focus and the ToolBar items which indicate the current value of the PropertySort property. 此修正包含高對比變更及非高對比案例的變更。This fix consists of a High Contrast change and a change for non-High Contrast scenarios.
  • 表示 PropertySort 屬性目前值的 PropertyGrid 控制項工具列項目支援 TogglePatternPropertyGrid control ToolBar items which indicates the current value of the PropertySort property support the TogglePattern.
  • 改善了朗讀程式對區分對齊選擇器中所選取對齊方式的支援。Improved Narrator support for distinguishing the selected alignment in the Alignment Picker.
  • 在表單上顯示空的 PropertyGrid 控制項時,它現在會接收焦點,而之前並不會。When an empty PropertyGrid control is displayed on a form, it will now receive focus where previously it would not.

使用高對比佈景主題中作業系統定義的色彩Use of OS-defined colors in High Contrast themes
  • FlatStyle 屬性設定為 FlatStyle.System (這是預設樣式) 的 ButtonCheckBox 控制項,現在使用選取的高對比佈景主題中作業系統定義的色彩。The Button and CheckBox controls with their FlatStyle property set to FlatStyle.System, which is the default style, now use OS-defined colors in High Contrast theme when selected. 以往,文字和背景色彩不會呈現對比,因此難以閱讀。Previously, text and background colors were not contrasting and were hard to read.
  • Enabled 屬性設定為 falseButtonCheckBoxRadioButtonLabelLinkLabelGroupBox 控制項,使用陰影色彩呈現高對比佈景主題中的文字,導致與背景的對比過低。The Button, CheckBox, RadioButton, Label, LinkLabel, and GroupBox controls with their Enabled property set to false used a shaded color to render text in High Contrast themes, resulting in low contrast against the background. 現在,這些控制項使用作業系統所定義的「已停用文字」色彩。Now these controls use the "Disabled Text" color defined by the OS. 此修正套用至 FlatStyle 屬性設定為非 FlatStyle.System 值的控制項。This fix applies to controls with the FlatStyle property set to a value other than FlatStyle.System. 後者的控制項是由作業系統呈現。The latter controls are rendered by the OS.
  • DataGridView 現在會於目前焦點所在的儲存格內容周圍呈現可見的矩形。DataGridView now renders a visible rectangle around the content of the cell which has the current focus. 之前,這不會顯示在特定的高對比佈景主題中。Previously, this was not visible in certain High Contrast themes.
  • Enabled 屬性設定為 falseToolStripMenuItem 控制項,現在使用作業系統所定義的「已停用文字」色彩。ToolStripMenuItem controls with their Enabled property set to false now use the "Disabled Text" color defined by the OS.
  • Checked 屬性設定為 trueToolStripMenuItem 控制項,現在以對比的系統色彩呈現相關聯的核取記號。ToolStripMenuItem controls with their Checked property set to true now render the associated check mark in a contrasting system color. 先前的核取記號色彩對比不足,無法在高對比佈景主題中顯示。Previously the check mark color was not contrasting enough and not visible in High Contrast themes.
注意:Windows 10 已變更某些高對比系統色彩的值。NOTE: Windows 10 has changed values for some high contrast system colors. Windows Forms 架構是以 Win32 架構為基礎。Windows Forms Framework is based on the Win32 framework. 為獲得最佳體驗、在最新版的 Windows 上執行,以及新增最新作業系統變更,請在測試應用程式中新增 app.manifest 檔案,並取消註解下列程式碼:For the best experience, run on the latest version of Windows and opt in to the latest OS changes by adding an app.manifest file in a test application and uncommenting the following code:
<!-- Windows 10 -->
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}" />

改善的鍵盤導覽Improved keyboard navigation
  • ComboBox 控制項將其 DropDownStyle 屬性設定為 ComboBoxStyle.DropDownList,且它是表單中定位順序的第一個控制項時,如果使用鍵盤來開啟父表單,它現在會顯示焦點矩形。When a ComboBox control has its DropDownStyle property set to ComboBoxStyle.DropDownList and is the first control in the tab order on the form, it now displays a focus rectangle when the parent form is opened using the keyboard. 在這項變更之前,鍵盤焦點是在這個控制項上,但不會呈現焦點指標。Before this change, keyboard focus was on this control, but a focus indicator was not rendered.
改善的朗讀程式支援Improved Narrator support
  • MonthCalendar 控制項已針對輔助技術新增存取控制項的支援,包括讓朗讀程式可以讀取先前無法讀取的控制項值。The MonthCalendar control has added support for assistive technologies to access the control, including the ability for Narrator to read the value of the control when previously it could not.
  • CheckedListBox 控制項現在會於 CheckBox.CheckState 屬性已變更時通知朗讀程式。The CheckedListBox control now notifies Narrator when a CheckBox.CheckState property has been changed. 之前,朗讀程式不會收到通知,因此使用者不會被告知 CheckState 屬性已更新。Previously, Narrator did not receive notification and as a result users would not be informed that the CheckState property had been updated.
  • LinkLabel 控制項已變更其告知朗讀程式有關控制項文字的方式。The LinkLabel control has changed the way it notifies Narrator of the text of in the control. 之前,朗讀程式會宣告這段文字兩次,並將 "&" 符號讀取為實際文字,即使使用者看不到這些文字也一樣。Previously, Narrator announced this text twice and read "&" symbols as real text even though they are not visible to a user. 已從朗讀程式宣告中移除重複的文字,以及不必要的 "&" 符號。The duplicated text was removed from the Narrator announcements, as well as unnecessary "&" symbols.
  • DataGridViewCell 控制項類型現在會正確地向朗讀程式和其他輔助技術報告唯讀狀態。The DataGridViewCell control types now correctly report the read-only status to Narrator and other assistive technologies.
  • 朗讀程式現在可以讀取 [Multiple-Document Interface]~/docs/framework/winforms/advanced/multiple-document-interface-mdi-applications.md) 應用程式中的子視窗系統功能表。Narrator is now able to read the System Menu of child windows in [Multiple-Document Interface]~/docs/framework/winforms/advanced/multiple-document-interface-mdi-applications.md) applications.
  • 朗讀程式現在可以讀取 ToolStripItem.Enabled 屬性設定為 falseToolStripMenuItem 控制項。Narrator is now able to read ToolStripMenuItem controls with a ToolStripItem.Enabled property set to false. 之前,朗讀程式無法將焦點放在已停用的功能表項目來讀取內容。Previously, Narrator was unable to focus on disabled menu items to read the content.
範圍Scope 主要Major
版本Version 4.7.14.7.1
輸入Type 正在重定目標Retargeting
受影響的 APIAffected APIs

Windows Presentation Foundation (WPF)Windows Presentation Foundation (WPF)

WPF 的協助工具改善Accessibility improvements in WPF

詳細資料Details 高對比改善High Contrast improvements
  • 現在會顯示 Expander 控制項的焦點。The focus for the Expander control is now visible. 在舊版 .NET Framework 中並非如此。In previous versions of the .NET Framework, it was not.
  • CheckBoxRadioButton 控制項在選取時,其中的文字現在比起舊版 .NET Framework 更容易查看。The text in CheckBox and RadioButton controls when they are selected is now easier to see than in previous .NET Framework versions.
  • 已停用 ComboBox 的框線現在與已停用文字的色彩相同。The border of a disabled ComboBox is now the same color as the disabled text. 在舊版 .NET Framework 中並非如此。In previous versions of the .NET Framework, it was not.
  • 已停用和聚焦按鈕現在會使用正確的佈景主題色彩。Disabled and focused buttons now use the correct theme color. 在舊版 .NET Framework 中並非如此。In previous versions of the .NET Framework, they did not.
  • ComboBox 控制項的樣式設定為 ToolBar.ComboBoxStyleKey 時,現在會顯示下拉式按鈕。在舊版 .NET Framework 中並非如此。The dropdown button is now visible when a ComboBox control's style is set to ToolBar.ComboBoxStyleKey, In previous versions of the .NET Framework, it was not.
  • DataGrid 控制項中的排序指標箭號現在會使用佈景主題色彩。The sort indicator arrow in a DataGrid control now uses theme colors. 在舊版 .NET Framework 中並非如此。In previous versions of the .NET Framework, it did not.
  • 預設的超連結樣式現在會在滑鼠移至上方時變更為正確的佈景主題色彩。The default hyperlink style now changes to the correct theme color on mouse over. 在舊版 .NET Framework 中並非如此。In previous versions of the .NET Framework, it did not.
  • 現在會顯示選項按鈕上的鍵盤焦點。The Keyboard focus on radio buttons is now visible. 在舊版 .NET Framework 中並非如此。In previous versions of the .NET Framework, it was not.
  • DataGrid 控制項的核取方塊資料行現在會使用鍵盤焦點回饋的預期色彩。The DataGrid control's checkbox column now uses the expected colors for keyboard focus feedback. 在舊版 .NET Framework 中並非如此。In previous versions of the .NET Framework, it did not.
  • 鍵盤焦點視覺效果現在會顯示在 ComboBoxListBox 控制項上。the Keyboard focus visuals are now visible on ComboBox and ListBox controls. 在舊版 .NET Framework 中並非如此。In previous versions of the .NET Framework, it was not.

螢幕助讀程式互動改善Screen reader interaction improvements
  • 螢幕助讀程式現在會將 Expander 控制項正確宣告為群組 (展開/摺疊)。Expander controls are now correctly announced as groups (expand/collapse) by screen readers.
  • 螢幕助讀程式現在會將 DataGridCell 控制項正確宣告為資料儲存格 (展開/摺疊)。DataGridCell controls are now correctly announced as data grid cell (localized) by screen readers.
  • 螢幕助讀程式現在會宣告可編輯 ComboBox 的名稱。Screen readers will now announce the name of an editable ComboBox.
  • 螢幕助讀程式不會再將 PasswordBox 控制項宣告為「檢視中無任何項目」。PasswordBox controls are no longer announced as "no item in view" by screen readers.

LiveRegion 支援LiveRegion support
朗讀程式這類螢幕助讀程式可協助人員了解應用程式 UI 內容,通常是透過描述目前焦點所在 UI 的相關內容,因為這可能是大部分使用者感興趣的項目。Screen readers such as Narrator help people know the UI contents of an application, usually by describing something about the UI that's currently focused, because that is probably the element of most interest to the user. 不過,如果螢幕某處的 UI 項目變更,而且沒有焦點,則使用者可能不會收到通知,並且可能會遺失重要資訊。However, if a UI element changes somewhere in the screen and it does not have the focus, the user may not be informed and miss important information. LiveRegions 旨在用來解決這個問題。LiveRegions are meant to solve this problem. 開發人員可以使用它們來通知螢幕助讀程式或任何其他 UI 自動化用戶端,已對 UI 項目進行重要變更。A developer can use them to inform the screen reader or any other UI Automation client that an important change has been made to a UI element. 螢幕助讀程式接著可以決定如何和何時通知使用者已進行這項變更。The screen reader can then decide how and when to inform the user of this change. LiveSetting 屬性還可讓螢幕助讀程式知道通知使用者 UI 所做變更的重要性。The LiveSetting property also lets the screen reader know how important it is to inform the user of the change made to the UI.
建議Suggestion 如何選擇加入或退出這些變更How to opt in or out of these changes
為了讓應用程式可受益於這些變更,它必須在 .NET Framework 4.7.1 或更新版本上執行。In order for the application to benefit from these changes, it must run on the .NET Framework 4.7.1 or later. 應用程式可以用下列任一種方式受益於這些變更:The application can benefit from these changes in either of the following ways:
  • 以 .NET Framework 4.7.1 為目標。Target the .NET Framework 4.7.1. 這是建議的處理方式。This is the recommended approach. 在以 .NET Framework 4.7.1 或更新版本為目標的 WPF 應用程式上,預設會啟用這些協助工具變更。These accessibility changes are enabled by default on WPF applications that target the .NET Framework 4.7.1 or later.
  • 藉由在 app config 檔案的 <runtime> 區段中新增下列 AppContext 參數,並將它設定為 false,選擇退出舊版協助工具行為,如下列範例所示。It opts out of the legacy accessibility behaviors by adding the following AppContext Switch in the <runtime> section of the app config file and setting it to false, as the following example shows.
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7"/>
</startup>
<runtime>
<!-- AppContextSwitchOverrides value attribute is in the form of 'key1=true/false;key2=true/false  -->
<AppContextSwitchOverrides value="Switch.UseLegacyAccessibilityFeatures=false" />
</runtime>
</configuration>
以 .NET Framework 4.7.1 或更新版本為目標,並且想要保留舊版協助工具行為的應用程式,可以藉由明確將此 AppContext 參數設為 true,選擇使用舊版的協助工具功能。Applications that target the .NET Framework 4.7.1 or later and want to preserve the legacy accessibility behavior can opt in to the use of legacy accessibility features by explicitly setting this AppContext switch to true.
如需 UI 自動化的概觀,請參閱 UI 自動化概觀For an overview of UI automation, see the UI Automation Overview.
範圍Scope 主要Major
版本Version 4.7.14.7.1
輸入Type 正在重定目標Retargeting
受影響的 APIAffected APIs

Selector 的 SelectionChanged 事件和 SelectedValue 屬性Selector SelectionChanged event and SelectedValue property

詳細資料Details 從 .NET Framework 4.7.1 開始,Selector 在其選取項目變更時,一律會先更新其 SelectedValue 屬性的值,再引發 SelectionChanged 事件。Starting with the .NET Framework 4.7.1, a Selector always updates the value of its SelectedValue property before raising the SelectionChanged event, when its selection changes. 這會讓 SelectedValue 屬性與其他的選取項目屬性一致 (SelectedItemSelectedIndex),它們會在引發事件前予以更新。This makes the SelectedValue property consistent with the other selection properties (SelectedItem and SelectedIndex), which are updated before raising the event.

在 .NET Framework 4.7 和舊版中,在大部分情況下,更新 SelectedValue 會發生在事件之前,但如果選取項目變更是由於變更 SelectedValue 屬性所造成,則會發生在事件之後。In the .NET Framework 4.7 and earlier versions, the update to SelectedValue happened before the event in most cases, but it happened after the event if the selection change was caused by changing the SelectedValue property.

建議Suggestion 以 .NET Framework 4.7.1 或更新版本為目標的應用程式可透過在應用程式組態檔的 <runtime> 區段中新增下列內容來選擇退出此變更,並使用舊版行為:Apps that target the .NET Framework 4.7.1 or later can opt out of this change and use legacy behavior by adding the following to the <runtime> section of the application configuration file:
<runtime>
<AppContextSwitchOverrides
value="Switch.System.Windows.Controls.TabControl.SelectionPropertiesCanLagBehindSelectionChangedEvent=true" />
</runtime>
以 .NET Framework 4.7 或舊版為目標但在 .NET Framework 4.7.1 或更新版本上執行的應用程式,只要在應用程式組態檔的 <runtime> 區段新增下列程式行,就能啟用新行為:Apps that target the .NET Framework 4.7 or earlier but are running on the .NET Framework 4.7.1 or later can enable the new behavior by adding the following line to the <runtime> section of the application .configuration file:
<runtime>
<AppContextSwitchOverrides value="Switch.System.Windows.Controls.TabControl.SelectionPropertiesCanLagBehindSelectionChangedEvent=false" />
</runtime>
範圍Scope 次要Minor
版本Version 4.7.14.7.1
類型Type 正在重定目標Retargeting
受影響的 APIAffected APIs

TabControl SelectionChanged 事件和 SelectedContent 屬性TabControl SelectionChanged event and SelectedContent property

詳細資料Details 從 .NET Framework 4.7.1 開始,TabControl 會在其選取項目變更時先更新其 SelectedContent 屬性的值,再引發 SelectionChanged 事件。在 .NET Framework 4.7 和舊版中,更新 SelectedContent 發生在事件之後。Starting with the .NET Framework 4.7.1, a TabControl updates the value of its SelectedContent property before raising the SelectionChanged event, when its selection changes.In the .NET Framework 4.7 and earlier versions, the update to SelectedContent happened after the event.
建議Suggestion 以 .NET Framework 4.7.1 或更新版本為目標的應用程式可透過在應用程式組態檔的 <runtime> 區段中新增下列內容來選擇退出此變更,並使用舊版行為:Apps that target the .NET Framework 4.7.1 or later can opt out of this change and use legacy behavior by adding the following to the <runtime> section of the application configuration file:
<runtime>
<AppContextSwitchOverrides value="Switch.System.Windows.Controls.TabControl.SelectionPropertiesCanLagBehindSelectionChangedEvent=true" />
</runtime>
以 .NET Framework 4.7 或舊版為目標但在 .NET Framework 4.7.1 或更新版本上執行的應用程式,只要在應用程式組態檔的 <runtime> 區段新增下列程式行,就能啟用新行為:Apps that target the .NET Framework 4.7 or earlier but are running on the .NET Framework 4.7.1 or later can enable the new behavior by adding the following line to the <runtime> section of the application .configuration file:
<runtime>
<AppContextSwitchOverrides value="Switch.System.Windows.Controls.TabControl.SelectionPropertiesCanLagBehindSelectionChangedEvent=false" />
</runtime>
範圍Scope 次要Minor
版本Version 4.7.14.7.1
類型Type 正在重定目標Retargeting
受影響的 APIAffected APIs

WPF PackageDigitalSignatureManager 的預設雜湊演算法現在是 SHA256The default hash algorithm for WPF PackageDigitalSignatureManager is now SHA256

詳細資料Details System.IO.Packaging.PackageDigitalSignatureManager 提供與 WPF 套件相關的數位簽章功能。The System.IO.Packaging.PackageDigitalSignatureManager provides functionality for digital signatures in relation to WPF packages. 在 .NET Framework 4.7 和舊版中,用來簽署套件各部分的預設演算法 (PackageDigitalSignatureManager.DefaultHashAlgorithm) 是 SHA1。In the .NET Framework 4.7 and earlier versions, the default algorithm (PackageDigitalSignatureManager.DefaultHashAlgorithm) used for signing parts of a package was SHA1. 由於最新的 SHA1 安全性考量之故,這個預設值從 .NET Framework 4.7.1 開始已變更為 SHA256。Due to recent security concerns with SHA1, this default has been changed to SHA256 starting with the .NET Framework 4.7.1. 這項變更會影響所有套件簽署,包括 XPS 文件。This change affects all package signing, including XPS documents.
建議Suggestion 開發人員若想要在目標設為低於 .NET Framework 4.7.1 的 Framework 版本時利用這項變更,或在目標設為 .NET Framework 4.7.1 或更高版本時使用先前的功能,可以適當地設定下列 AppContext 旗標。A developer who wants to utilize this change while targeting a framework version below .NET Framework 4.7.1 or a developer who requires the previous functionality while targeting .NET Framework 4.7.1 or greater can set the following AppContext flag appropriately. true 值會導致使用 SHA1 作為預設演算法;false 值則導致使用 SHA256。A value of true will result in SHA1 being used as the default algorithm; false results in SHA256.
<configuration>
<runtime>
<AppContextSwitchOverrides value="Switch.MS.Internal.UseSha1AsDefaultHashAlgorithmForDigitalSignatures=true"/>
</runtime>
</configuration>
範圍Scope EdgeEdge
版本Version 4.7.14.7.1
類型Type 正在重定目標Retargeting
受影響的 APIAffected APIs

Windows Workflow Foundation (WF)Windows Workflow Foundation (WF)

Windows Workflow Foundation (WF) 工作流程設計工具中的協助工具改善Accessibility improvements in Windows Workflow Foundation (WF) workflow designer

詳細資料Details Windows Workflow Foundation (WF) 工作流程設計工具正在使用協助工具技術改善其運作方式。The Windows Workflow Foundation (WF) workflow designer is improving how it works with accessibility technologies. 這些改善包括下列變更:These improvements include the following changes:
  • 在某些控制項中,定位順序變更為由左至右及由上至下:The tab order is changed to left to right and top to bottom in some controls:
  • 設定 InitializeCorrelation 活動之關聯性資料的初始化關聯性視窗The initialize correlation window for setting correlation data for the InitializeCorrelation activity
  • ReceiveSendSendReplyReceiveReply 活動的內容定義視窗The content definition window for the Receive, Send, SendReply, and ReceiveReply activities
  • 可透過鍵盤使用多個功能:More functions are available via the keyboard:
  • 編輯活動的屬性時,如果第一次將焦點放在屬性群組,可以透過鍵盤將其摺疊。When editing the properties of an activity, property groups can be collapsed by keyboard the first time they are focused.
  • 現在可透過鍵盤存取警告圖示。Warning icons are now accessible by keyboard.
  • 現在可透過鍵盤存取 [屬性] 視窗中的 [其他屬性] 按鈕。The More Properties button in the Properties window is now accessible by keyboard.
  • 鍵盤使用者現在可以存取工作流程設計工具之 [引數] 和 [變數] 窗格中的標頭項目。Keyboard users now can access the header items in the Arguments and Variables panes of the Workflow Designer.
  • 在以下這類情況發生時,已改善具有焦點之項目的可見性:Improved visibility of items with focus, such as when:
  • 在工作流程設計工具與活動設計工具所使用的資料格中新增資料列。Adding rows to data grids used by the Workflow Designer and activity designers.
  • 使用 Tab 鍵循環顯示 ReceiveReplySendReply 活動的欄位。Tabbing through fields in the ReceiveReply and SendReply activities.
  • 設定變數或引數的預設值Setting default values for variables or arguments
  • 螢幕助讀程式現在可以正確辨識:Screen readers can now correctly recognize:
  • 工作流程設計工具中設定的中斷點。Breakpoints set in the workflow designer.
  • FlowSwitch<T>FlowDecisionCorrelationScope 活動。The FlowSwitch<T>, FlowDecision, and CorrelationScope activities.
  • Receive 活動的內容。The contents of the Receive activity.
  • InvokeMethod 活動的目標類型。The Target Type for the InvokeMethod activity.
  • TryCatch 活動中的例外狀況下拉式方塊和 Finally 區段。The Exception combobox and the Finally section in the TryCatch activity.
  • 傳訊活動 (ReceiveSendSendReplyReceiveReply) 中的 [訊息類型] 下拉式方塊、[新增關聯性初始設定式] 視窗、[內容定義] 視窗和 [CorrelatesOn 定義] 視窗。The Message Type combobox, the splitter in the Add Correlation Initializers window, the Content Definition window, and the CorrelatesOn Defintion window in the messaging activities (Receive, Send, SendReply, and ReceiveReply).
  • 狀態機器轉換和轉換目的地。State machine transitions and transitions destinations.
  • FlowDecision 活動的註釋和連接器。Annotations and connectors on FlowDecision activities.
  • 活動的操作 (右鍵) 功能表。The context (right-click) menus for activities.
  • 屬性方格中的屬性值編輯器、[清除搜尋] 按鈕、[依分類] 及 [字母順序] 排序按鈕和 [運算式編輯器] 對話方塊。The property value editors, the Clear Search button, the By Category and Alphabetical sort buttons, and the Expression Editor dialog in the properties grid.
  • 工作流程設計工具中的顯示比例百分比。The zoom percentage in the Workflow Designer.
  • ParallelPick 活動中的分隔符號。The separator in Parallel and Pick activities.
  • InvokeDelegate 活動。The InvokeDelegate activity.
  • 字典活動 (Microsoft.Activities.AddToDictionary<TKey,TValue>Microsoft.Activities.RemoveFromDictionary<TKey,TValue> 等) 的 [選取類型] 視窗。The Select Types window for dictionary activities (Microsoft.Activities.AddToDictionary<TKey,TValue>, Microsoft.Activities.RemoveFromDictionary<TKey,TValue>, etc.).
  • [瀏覽並選取 .NET 類型] 視窗。The Browse and Select .NET Type window.
  • 工作流程設計工具中的階層連結。Breadcrumbs in the Workflow Designer.
  • 選擇高對比佈景主題的使用者會看到工作流程設計工具和其控制項在可見性方面的許多改善,例如項目之間的更佳對比比例以及用於焦點項目的更明顯選取方塊。Users who choose High Contrast themes will see many improvements in the visibility of the Workflow Designer and its controls like better contrast ratios between elements and more noticeable selection boxes used for focus elements.
建議Suggestion 如果您使用已重新裝載工作流程設計工具的應用程式,藉由執行上述其中一個動作,您的應用程式可以受益於這些變更:If you have an application with a re-hosted workflow designer, your application can benefit from these changes by performing either of these actions:
  • 重新編譯應用程式,使其以 .NET Framework 4.7.1 為目標。Recompile your application to target the .NET Framework 4.7.1. 預設會啟用這些協助工具變更。These accessibility changes are enabled by default.
  • 應用程式若以 .NET Framework 4.7 或舊版為目標,但卻在 .NET Framework 4.7.1 上執行,您可以在 app.config 檔案的 區段中新增下列 AppContext 參數<runtime>,並將它設定為 false,選擇退出這些舊版協助工具行為,如下列範例所示。If your application targets the .NET Framework 4.7 or earlier but is running on the .NET Framework 4.7.1, you can opt out of these legacy accessibility behaviors by adding the following AppContext switch to the <runtime> section of the app.config file and set it to false, as the following example shows.
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7"/>
</startup>
<runtime>
<!-- AppContextSwitchOverrides value attribute is in the form of 'key1=true/false;key2=true/false  -->
<AppContextSwitchOverrides value="Switch.UseLegacyAccessibilityFeatures=false" />
</runtime>
</configuration>
以 .NET Framework 4.7.1 或更新版本為目標,並且想要保留舊版協助工具行為的應用程式,可以藉由明確將此 AppContext 參數設為 true,選擇加入舊版的協助工具功能。Applications that target the .NET Framework 4.7.1 or later and want to preserve the legacy accessibility behavior can opt in to the use of legacy accessibility features by explicitly setting this AppContext switch to true.
範圍Scope 微幅Minor
版本Version 4.7.14.7.1
類型Type 正在重定目標Retargeting