We are currently moving our Xamarin projects from PCL to .Net Standard 2.0, also core library project format. Most things works well. We use resx-files in the core project for localization. This works fine on iOS and Android.
On UWP I get null
as value, if I try to access the string ressources
var buttonText = AppResources.Cancel; // => null
The PCL version the same code worked well. Is there some initialization needed?
On debug I can see that the resource manager has a null
ResourceSet, but _WinRTResourceManager
is filled.
Xamarin.Forms UWP
with.NetStandard 2.0
.But I could not reproduce your issue andAppResources
works in my side. Could share a simple sample that can reproduce this issue ? - Nico Zhu - MSFTResourceManager
looks like in the Full app (null for resource set and filled WinRT part). I will write the solution, if I find the difference betweeen the test and full app. - WebDucerPackage.appxmanifest
from the default valueen-US
tode-DE
the resources from .Net Standard library could not be read. The fix is, to define explixit theNeutralResourcesLanguage
for the .Net Standard library (to the same as UWP project). This can be done in manually created AssemblyInfo.cs (do not forget to turn off auto generation of AssemblyInfo) or declare this info in one of the exsisting classen[assembly: NeutralResourcesLanguage("de-DE")]
- WebDucer<NeutralLanguage>en-US</NeutralLanguage>
in my .NET Standard class lib and it started working. - kspearrin