This repository illustrates a Visual Studio 2017 localization issue.
The sample app contains a UWP app and a PCL library with localized RESX file (LocalizedStrings.rex, LocalizedStrings.cs.resx). Culture is set in the app's constructor as follows:
CultureInfo.CurrentUICulture = new CultureInfo("cs");
CultureInfo.CurrentCulture = new CultureInfo("cs");
When launched for debugging, the localized resources are never displayed and the app will show neutral RESX strings only. When debugged in Visual Studio 2015, it works as expected.
- Clone the repo
- Open the solution VSResxIssue\VSResxIssue.sln in Visual Studio 2017
- Clean the solution
- Debug UWP app on Local Machine in x86
- The text in the launched app will read Neutral (neutral resource is loaded)
- Close VS 2017
- Open the solution in Visual Studio 2015
- Clean the solution
- Debug UWP app on Local Machine in x86
- The text in the launched app will read Localized (localized cs resource is loaded)
Text should read Localized in step 5.
I have observed that this problem occurs only for Debug build. Release build loads the localized resources even in VS 2017.
- Microsoft Visual Studio Enterprise 2017 Version 15.0.26228.9
- Microsoft .NET Framework Version 4.6.01586
- Visual Studio Tools for Universal Windows Apps 15.0.26228.00
- Xamarin 4.3.0.784