How to fix “CA1810: Initialize reference type static fields inline” with an abstract base…?
问题 Here's the simplified parts of code that I have: abstract class DataManager<TValue> { protected static Dictionary<string, TValue> Values; } and then I have: class TextManager : DataManager<string> { static TextManager() { Values = ... // Fill with data } } And, now I'm getting CA1810. I see a few solutions, like making Values public and setting them elsewhere, but I don't like that, or making a static method in TextManager to do the same thing, but is invoked when the program starts, but I