© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•3y ago•
17 replies
Ice_

Dependency injection in WPF

I'm trying to do DI in my WPF app. I've read about it on different sites and followed youtubers but it doesn't seem to work (it runs but I can't reach the registered service, it'll always be null).
I am basically trying to inject a DbContext as a Singleton because its scoped nature is causing some issues in the application (entity mismatching etc. = badly written code probably).
Help/Tips please!
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

WPF local: when using Dependency Injection
C#CC# / help
15mo ago
Dependency injection
C#CC# / help
6mo ago
✅ Dependency injection
C#CC# / help
2y ago
❔ Dependency Injection
C#CC# / help
3y ago