turquoiseowl / i18n

Smart internationalization for ASP.NET
Other
556 stars 156 forks source link

thread culture in async methods #348

Open edesantis opened 6 years ago

edesantis commented 6 years ago

Hi all,

First, congrats for the great job in this library =)

for yor information:

If you try to execute some async method (for example in web.api) and sets the culture for the thread, you note the culture not changed. This is because the sincronization context not sync all the threads at same time. To fix this put this line in app.settings or web.config file.

<add key="appContext.SetSwitch:Switch.System.Globalization.NoAsyncCurrentCulture" value="true" />