runtime: ResourceManager.GetString always returns english when using netcoreapp
This is a continuation of aspnet/Localization#293.
Steps to reproduce
- Clone and run this repo app.
- See that the value from the english resx has been returned even though the current culture is swedish.
- Move
net451to the top of the frameworks in project.json to run the project undernet451instead of netcoreapp. - Note that when run under
net451an exception is thrown because the swedish version of the given resource doesn’t exist.
Note that this only seems to apply to english (at least on my computer, likely this is dependent on the installed language), if you only had a french resource in your project you would get the expected behavior of a throw exception.
Expected behavior
We expect the netcoreapp version of ResourceManager to behave the same as the net451 one, throwing an exception when a resource isn’t found and no neutral language is explicitly set.
Actual behavior
The english resource is returned, even though the current culture is swedish.
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Reactions: 1
- Comments: 29 (21 by maintainers)
Interestingly setting the NeutralResourcesLanguage in AssemblyInfo DOES set resourceManager._neutralResourcesCulture to that language, but does NOT affect this behavior as one might expect after reading this area of the ResourceManager.