CopyPastor

Detecting plagiarism made easy.

Score: 1; Reported for: Exact paragraph match Open both answers

Possible Plagiarism

Plagiarized on 2025-02-05
by Luis Rosa

Original Post

Original - Posted on 2020-09-07
by mm8



            
Present in both answers; Present only in the new answer; Present only in the old answer;

Just in case someone arrives here with this issue, the solution for our case was to add a line to app.config <AppContextSwitchOverrides value="Switch.System.Globalization.NoAsyncCurrentCulture=true"/>
<!-- begin snippet: js hide: false console: true babel: false babelPresetReact: false babelPresetTS: false -->
<!-- language: lang-html -->
<?xml version="1.0" encoding="utf-8"?> <configuration> <startup> <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8"/> </startup> <runtime> <AppContextSwitchOverrides value="Switch.System.Globalization.NoAsyncCurrentCulture=true"/> </runtime> </configuration>
<!-- end snippet -->

In .NET Core these properties are implemented as `AsyncLocal<T>`'s which in short means that any updates to them only affect the current asynchronous control flow, such as an `async` method.
Depending on what you are trying to accomplish, you may consider to create and set your own static `CultureInfo` properties.
On .NET Framework 4.6 and later, you could set the `NoAsyncCurrentCulture` switch to `true` in your `App.config` to get back the old behaviour:
<?xml version="1.0" encoding="utf-8"?> <configuration> <startup> <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8"/> </startup> <runtime> <AppContextSwitchOverrides value="Switch.System.Globalization.NoAsyncCurrentCulture=true"/> </runtime> </configuration>
[&lt;AppContextSwitchOverrides&gt; element](https://learn.microsoft.com/en-us/dotnet/framework/configure-apps/file-schema/runtime/appcontextswitchoverrides-element?WT.mc_id=WD-MVP-5001077)
[Retargeting Changes for Migration from .NET Framework 4.5 to 4.6](https://learn.microsoft.com/en-us/dotnet/framework/migration-guide/retargeting/4.5-4.6?WT.mc_id=WD-MVP-5001077)

        
Present in both answers; Present only in the new answer; Present only in the old answer;