IStringLocalizer does not find resources if RootNamespace is set but not AssemblyName
- Dominant language
- C#
- Stars
- 38.4k
- Forks
- 10.9k
- Avg merge
- 2d 10h
- Merged PRs (30d)
- 281
Description
### Is there an existing issue for this?
- [x] I have searched the existing issues
### Describe the bug
Hello all,
When setting the RootNamespace but not the AssemblyName in the csproj prevents localization (IStringLocalizer, e.g.) to locate the resources from the library.
This seems to be a regression, from what I could gather from other issues this was previously resolved but now is broken again on .net 8 and 9.
I've created a [minimal reproducer](https://github.com/jjolidon/dotnet-reproducer-localization). Uncommenting tag in the csproj to set the AssemblyName works around the issue. This has been tested on .net 8 (in my own project) and 9 (reproducer).
If this is an unsupported scenario, the documentation is unclear and should probably be updated. Otherwise it's clearly an issue to me.
Let me know your thoughts,
Jérôme
### Expected Behavior
Resources should be found properly regardless of the AssemblyName and RootNamespace values.
### Steps To Reproduce
See [minimal reproducer](https://github.com/jjolidon/dotnet-reproducer-localization), but the gist of it is:
- AddLocalization
- Add resources
- Change RootNamespace => resources not found
- Add AssemblyName => resources found again
### Exceptions (if any)
_No response_
### .NET Version
9.0.100
### Anything else?
AspNetCore 9.0.0 and 8.0.10 affected.
Contributor guide
Assessment
This issue has not been assessed yet.