I use the aspnet.core sample and reference a dotnet standard 2.1 library with existing satellite assemblies for localization.
Then I run the aspnet.core app and it works with localization in Windows 10 as expected.
In Ubuntu 18.04 and Docker Runtime 3.1 the localization does not work for the referenced library and its satellite assemblies.
tested/affected operating system:
Windows with IIS Express - works as expected / localized assemblies are used
Ubuntu 18.04 with Kestrel - localized assemblies are not used
Dotnet Core Docker Container 3.1 with Kestrel from mcr.microsoft.com/dotnet/core/aspnet:3.1 - localized assemblies are not used
./Runtime
./Topography --> .Net Standard Library with satellite assemblies
./aspnetapp --> ASP.NET Core Sample
./aspnetapp.dll
./aspnetapp.Views.dll
./Czm.Biometry.Topography.Core.dll
./Czm.Biometry.Topography.Gui.dll
./Czm.Biometry.Topography.Interfaces.dll
./Czm.Biometry.Utilities.Core.dll
./Czm.Biometry.Utilities.Interfaces.dll
./de-DE/Czm.Biometry.Topography.Gui.resources.dll
./fr-FR/Czm.Biometry.Topography.Gui.resources.dll
./System.Drawing.Common.dll
Run aspnetapp Solution
dotnet build in aspnetapp directory
dotnet aspnetapp.dll in Runtime directory
FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build
WORKDIR /app
# copy csproj and restore as distinct layers
COPY aspnetapp/*.sln .
COPY aspnetapp/aspnetapp/*.csproj ./aspnetapp/
COPY Topography/* ./Topography/
RUN dotnet restore
# copy everything else and build app
COPY aspnetapp/aspnetapp/. ./aspnetapp/
COPY ./Topography/. ./Topography/
COPY aspnetapp/CodeAnalyzers/ ./CodeAnalyzers/
WORKDIR /app/aspnetapp
RUN dotnet publish -c Debug -o out
FROM mcr.microsoft.com/dotnet/core/aspnet:3.1 AS runtime
# install libgdiplus for System.Drawing
RUN apt-get update && \
apt-get install -y --allow-unauthenticated libgdiplus libc6-dev
# install x11 for System.Drawing
RUN apt-get update && \
apt-get install -y --allow-unauthenticated libx11-dev
#debugging
RUN apt update && \
apt install unzip && \
curl -sSL https://aka.ms/getvsdbgsh | /bin/sh /dev/stdin -v latest -l /vsdbg
RUN apt-get update && \
apt-get install -y --allow-unauthenticated procps
#install localization
RUN apt update && \
apt-get install -y --allow-unauthenticated locales
RUN sed -i -e 's/# de_DE.UTF-8 UTF-8/de_DE.UTF-8 UTF-8/' /etc/locale.gen && \
sed -i -e 's/# fr_FR.UTF-8 UTF-8/fr_FR.UTF-8 UTF-8/' /etc/locale.gen && \
locale-gen
ENV LANG de_DE
ENV LANGUAGE de_DE
ENV LC_ALL de_DE
# Disable the invariant mode (set in base image)
ENV DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=false
WORKDIR /aspnetapp
COPY aspnetapp/intel/*.* ./intel/
ENV LD_LIBRARY_PATH=./intel:$LD_LIBRARY_PATH
COPY --from=build /app/aspnetapp/out ./
COPY ./Topography/de-DE/ ./de-DE/
COPY ./Topography/fr-FR/ ./fr-FR/
#ENTRYPOINT ["dotnet", "aspnetapp.dll"]
Thanks for contacting us.
We'll look into what's causing this and get back to you.
Help is really appreciated, since most descriptions about ASP.Net Core Localization only describe the Web Application Code and do not give any details about localization of referenced libraries:
https://docs.microsoft.com/en-us/aspnet/core/fundamentals/localization?view=aspnetcore-3.1
https://docs.microsoft.com/en-us/dotnet/standard/globalization-localization/
Also a best practice for cross-platform localization of .Net Standard libraries is really appreciated, if anyone can provide this information.
Most helpful comment
Help is really appreciated, since most descriptions about ASP.Net Core Localization only describe the Web Application Code and do not give any details about localization of referenced libraries:
https://docs.microsoft.com/en-us/aspnet/core/fundamentals/localization?view=aspnetcore-3.1
https://docs.microsoft.com/en-us/dotnet/standard/globalization-localization/
Also a best practice for cross-platform localization of .Net Standard libraries is really appreciated, if anyone can provide this information.