## CurrentCulture is not preserved across WPF Dispatcher operations ### Scope Minor ### Version Introduced 4.6 ### Version Reverted 4.6.2 ### Source Analyzer Status Planned ### Change Description Beginning in the .NET Framework 4.6, changes to or made within a will be lost at the end of that dispatcher operation. Similarly, changes to or made outside of a Dispatcher operation may not be reflected when that operation executes. Practically speaking, this means that and changes may not flow between WPF UI callbacks and other code in a WPF application. This is due to a change in that causes and to be stored in the execution context beginning with apps targeting the .NET Framework 4.6. WPF dispatcher operations store the execution context used to begin the operation and restore the previous context when the operation is completed. Because and are now part of that context, changes to them within a dispatcher operation are not persisted outside of the operation. - [x] Quirked - [ ] Build-time break ### Recommended Action Apps affected by this change may work around it by storing the desired or in a field and checking in all Dispatcher operation bodies (including UI event callback handlers) that the correct and are set. Alternatively, because the ExecutionContext change underlying this WPF change only affects apps targeting the .NET Framework 4.6 or newer, this break can be avoided by targeting the .NET Framework 4.5.2. Apps that target .NET Framework 4.6 or later can also work around this by setting the following compatibility switch: ```csharp AppContext.SetSwitch("Switch.System.Globalization.NoAsyncCurrentCulture", true); ``` This issue has been fixed by WPF in .NET Framework 4.6.2. It has also been fixed in .NET Frameworks 4.6, 4.6.1 through [KB 3139549](https://support.microsoft.com/kb/3139549). Applications targeting .NET Framework 4.6 or later will automatically get the right behavior in WPF applications - /) would be preserved across Dispatcher operations. ### Affected APIs * Not detectable via API analysis ### Category Windows Presentation Foundation (WPF)