❔ .net core 6 IConfiguration Injection
Hi there - i'm going nuts try to solve this simple problem. I have a .net Core 6 WebApplication builder based app, and all i'm trying to do is get to IConfiguration in my service classes.
From what i've read, .net 6 should automatically add its IConfiguration service to the build services, and therefore my AddService<MyClass> constructor whcih has public MyClass(IConfiguration configuration) in it throws "The service implementation object was not initialized or is not available." and it's not hitting breakpoints. Remove IConfiguration from teh constructor, it works
it's like either a) IConfiguration is not injected into the services for the app builder, or b) MyClass is not subject to being DI'd by asp.net.
argh
From what i've read, .net 6 should automatically add its IConfiguration service to the build services, and therefore my AddService<MyClass> constructor whcih has public MyClass(IConfiguration configuration) in it throws "The service implementation object was not initialized or is not available." and it's not hitting breakpoints. Remove IConfiguration from teh constructor, it works
it's like either a) IConfiguration is not injected into the services for the app builder, or b) MyClass is not subject to being DI'd by asp.net.
argh