C
C#9mo ago
Eple

Why does it give the error?

Here the property is not marked as static. Why does it give the message Cannot access non-static field '_settingsService' in static context?
No description
2 Replies
Jimmacle
Jimmacle9mo ago
you can't access non-static members in property initializers like that, you'll have to do it in an explicit constructor
Eple
EpleOP9mo ago
Got it, thanks.

Did you find this page helpful?