Description
SR.UsingResourceKeys
is a property meant to be set to true if the resources should not report full resource strings, but instead just the resource key itself. This is used for example in .NET Native but we now plan to potentially use it when trimming apps in .NET Core well. The advantage of doing this is that the tooling can remove the relatively large string resources and thus reduce the size of an app.
The intent of this feature was to use the resource key value instead of the resource string for an error message. So for example instead of: "Value cannot be null" it should return "ArgumentNull_Generic".
Unfortunately the code currently returns empty strings only. This is because the System.SR.GetResourceString(string)
overload calls GetResourceString(resourceKey, string.Empty);
but the implementation of that will only return the resourceKey
if the second parameter is null
- which in this case pretty much never is. Otherwise it returns he second parameter which is always null.