The default value or neutral resource for the resource is not set.

I am creating a UWP application that supports two languages ​​(en and de). I created both files Resource.reswand testfile.xmlone that is basically the data source of my application. If I run the application directly from Visual Studio ( DEBUGor RELEASEmode), it works fine, but as soon as I install it from the repository or WinAppDeployCmd.exedownload it to the device through , it will not load the resource fromResources.resw

This is my file structure inside the Strings directory:

row folder

I have a link to the test file specified in the file Resources.reswas follows: resources.resw

After starting the application, I use the ResourceLoaderkeys Testfileto load the file rights (en or de) to get the value .

var loader = new Windows.ApplicationModel.Resources.ResourceLoader();
var value = loader.GetString("Testfile");
var testfile = Path.Combine(Package.Current.InstalledLocation.Path + "/Strings/", value);

MakePRI : warning 0xdef01051: No default or neutral resource given for 'Files/Project/Strings/testfile_de.xml'. The application may throw an exception for certain user configurations when retrieving the resources.
MakePRI : warning 0xdef00522: Resources found for language(s) 'en,de' but no resources found for default language(s): 'en-US'. Change the default language or qualify resources with the default language.

, , ?

+4
2

, - en-US. en!

+2

<DefaultLanguage>en</DefaultLanguage> .csproj

+1

Source: https://habr.com/ru/post/1629453/


All Articles