_From @domyd on July 24, 2018 10:50_
Localized satellite packages do not seem to work in a Xamarin app when using the PackageReference restore method.
Likely related: https://github.com/Humanizr/Humanizer/issues/380
Repro project: SatelliteAssemblyApp.zip. It's a git project with two additional branches: (Note: the referenced test nuget packages are included in /localpackages and restoring them should just work)
works-single-package references one single NuGet package (SatelliteAssemblyTest.1.0.0) that includes the main assembly and one localized resource DLL.doesnt-work-multiple-packages references two NuGet packages: SatelliteAssemblyTest.1.0.1 (which only has the main assembly) and SatelliteAssemblyTest.de.1.0.1 (which only contains the localized resource DLL).1) Build solution in Release mode
2) Archive Android project to get an APK
The localized resource DLLs are included in the APK in both cases (/assemblies/de/SatelliteAssemblyTest.resources.dll exists within the APK). On a device with German culture, the label on the main page should say "Deutsch" in both cases.
Expected APK: works-single-package.zip
The localized resources are missing in the case of split nuget packages (/assemblies/de doesn't exist within the APK). On a device with German culture, the label on the main page says "English".
Actual APK: doesnt-work-multiple-packages.zip
_Copied from original issue: xamarin/Xamarin.Forms#3386_
Any workarounds on this?
Hi Guys any progress on this?
This is still an issue! Any progress? Any workarounds?
Any updates or workarounds for this issue?
Ping? We're still getting reports of this:
moved to flutter
Can we open a sister issue on the iOS side of things? Where would it go?
No idea for a solution ? That's really problematic
This issue prevents Humanizer from being used in localized Xamarin projects (see https://github.com/Humanizr/Humanizer/issues/799). This is especially problematic, as Humanizer is described as compatible to Xamarin and this issue does only starts to appear when non english translation are added later on in the development process.
It seems the iOS counterpart of this issue has been fixed in https://github.com/xamarin/xamarin-macios/issues/7113.
Sorry, I know this is an old ticket....
I don't see NuGet's <ResolveNuGetPackageAssets/> MSBuild task returning the satellite assembly, and so the remainder of the build doesn't even know about this file.
The cause of this behavior seems to be:
But if I set $(NuGetRuntimeIdentifier) and $(RuntimeIdentifiers):
msbuild .\SatelliteAssemblyApp\SatelliteAssemblyApp.Android\SatelliteAssemblyApp.Android.csproj /p:Configuration=Release /t:SignAndroidPackage /bl /r /p:NuGetRuntimeIdentifier=MonoAndroid8.1 /p:RuntimeIdentifiers=MonoAndroid8.1
This makes <ResolveNuGetPackageAssets/> returns the satellite assembly. But it still doesn't make it to the .apk file 馃槥 .
Let me review this behavior in .NET 5/6 and see what happens there: https://github.com/xamarin/net6-samples
It appears that this is going to "just work" in .NET 6. But keep in mind, this is under active development:
https://github.com/xamarin/net6-samples/compare/satelliteassemblies
Thank you very much for looking into this!
It appears that this is going to "just work" in .NET 6.
Does this mean this issue will not be resolved until .NET 6 is ready to use?
@cemrich I'm unsure about setting $(NuGetRuntimeIdentifier) and $(RuntimeIdentifiers) in "legacy" MSBuild projects to workaround NuGet. It doesn't feel quite right...
I will need to do more research.
I worked around this issue by referencing the Humanizer dlls directly from my head projects and the shared project. I placed the dlls inside a separate project directory with following structure:
Humanizer.dll
de/Humanizer.resources.dll
I have not yet tested this solution for more than one localization package.
Most helpful comment
This is still an issue! Any progress? Any workarounds?