I have culture specific resource files in App_GlobalResources folder. Now I need to read value of the DisplayName attribute from this resource files. I am using:
[Display(Name = "MerchantName", ResourceType = typeof(Resource))]
public string Merchant { get; set; }
but I am getting the following error:
Cannot retrieve property 'Name' because localization failed. Type 'Resources.Resource' is not public or does not contain a public static string property with the name 'MerchantName'.
How do I solve this problem?
In my case I had to change the Access modifier of my resource from Internal to Public.
By default all Resources are created as Internal.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With