Open thepra opened 4 days ago
Thank you for filing this issue. In order for us to investigate this issue, please provide a minimal repro project that illustrates the problem without unnecessary code. Please share with us in a public GitHub repo because we cannot open ZIP attachments, and don't include any confidential content.
Hi @thepra. We have added the "Needs: Author Feedback" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.
Is there an existing issue for this?
Describe the bug
My current project is structured by the template: MyApp.Server(WebApi standalone server), MyApp.Shared and MyApp.Client(Blazor wasm project).
Now I've put some shared localization resources between the client and the server in the "Shared" library in such configuration:
(with public classes exposed)
in .NET 7 this setup did work both at development and publish(prod) times, now in .NET 8 only when developing the translations are picked up correctly and after publishing the string translations are not picked up at all, with the result that the errors and field names are not translated. (Plus the client itself has it's own different resource files)
In the client I merged the different resources into a single singleton service class, like this:
It works as it should for the
PagesLoc
resources but the otherFieldsNameResource
andErrorsResource
resources are not working.Expected Behavior
IStringLocalizer
should work for resources coming from external library projects.Steps To Reproduce
^ In the Describe the bug I put it all
Exceptions (if any)
No response
.NET Version
8.0.302
Anything else?
.NET SDK: Version: 8.0.302 Commit: ef14e02af8 Workload version: 8.0.300-manifests.5273bb1c MSBuild version: 17.10.4+10fbfbf2e Ambiente di runtime: OS Name: Windows OS Version: 10.0.19045 OS Platform: Windows RID: win-x64 Base Path: C:\Program Files\dotnet\sdk\8.0.302\ Carichi di lavoro .NET installati: [wasm-tools] Origine dell'installazione: VS 17.10.35013.160 Versioni del manifesto: 8.0.5/8.0.100 Percorso del manifesto: C:\Program Files\dotnet\sdk-manifests\8.0.100\microsoft.net.workload.mono.toolchain.current\8.0.5\WorkloadManifest.json Tipo di installazione: FileBased Host: Version: 8.0.6 Architecture: x64 Commit: 3b8b000a0e .NET SDKs installed: 8.0.302 [C:\Program Files\dotnet\sdk] .NET runtimes installed: Microsoft.AspNetCore.App 7.0.20 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 8.0.6 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.NETCore.App 6.0.31 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 7.0.20 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 8.0.6 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.WindowsDesktop.App 6.0.31 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 7.0.20 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 8.0.6 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Other architectures found: x86 [C:\Program Files (x86)\dotnet] registered at [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\x86\InstallLocation] Environment variables: Not set global.json file: Not found Learn more: https://aka.ms/dotnet/info Download .NET: https://aka.ms/dotnet/download