I'm trying to build my first ASP.NET vNext web application and the problem I've faced is that I can't get IOptions<AppSettings> injected to my Startup.Configure() method. The odd thing is that MVC sample site which was generated by VS2015 does the same steps but the same injecting works! Both projects are run on Desktop CLR and use 1.0.0-beta4 binaries. I have created gist with my project's files. I will appreciate any advise or help with this.
In your ConfigureServices method, try adding the following:
services.AddOptions()
This registers OptionsManager<> which is used to resolve the services of type IOptions<>.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With