New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Shared resource file not available in asp.net core 3.1 #17733
Comments
Got same issue, any workaround ? |
After debugging, found the reason. Show as below.
@emedbo |
@tai-yi Thank you, I did not see that. That is very strange and something that should have been in the asp.net core 3.1 release notes imo. |
Thanks, I had this issue also , moving the file fixed it! |
i have the same problem, moving the file fixed it! great |
As part of the 3.1 release, the .NET SDK changed how namespaces for resource files are calculated. Let's look at the sample shared by @emedbo:
There's few options here: a) Move the SharedResources file as noted #17733 (comment) |
This issue has been resolved and has not had any activity for 1 day. It will be closed for housekeeping purposes. See our Issue Management Policies for more information. |
Hi @pranavkm. |
I've been on this issue for hours, everything was configured correctly and still it didn't work until i moved the base dummy class to the root of the project and changed its namespace to the root as well (which is a necessary step and wont work without it). |
Describe the bug
Resources referenced through SharedResources via
@inject IStringLocalizer<SharedResources> SharedResources
does not work using .net core sdk version 3.1.100
To Reproduce
Project to reproduce:
https://www.dropbox.com/s/ez38k7jz9zt3ev8/WebApplication.zip?dl=0
Provided attached repro project, build project using
dotnet build *.sln
.Run project and navigate to page. When referencing .net core 3.0.101 in global.json, SharedResources can be used in Index.cshtml ("Value from shared resources" is displayed on top)
When changing to sdk 3.1.100 (or removing global.json) with installed .net core sdk 3.1, values from SharedResources is not displayed correctly ("ValueFromSharedResources" is displayed instead).
Further technical details
dotnet --info
The text was updated successfully, but these errors were encountered: