Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2016/03/19/integrating-asp-net-core-configuration-in-mvc-4/ #10

Open
utterances-bot opened this issue Nov 12, 2021 · 1 comment
Open

Comments

@utterances-bot
Copy link

Integrating ASP.NET Core Configuration in MVC 4 - Scott Dorman

ASP.NET Core 1.0 (what had been called ASP.NET 5) is a complete redesign of ASP.NET that is open-source and cross-platform. Since this is a redesign of the framework, it comes with a lot of architectural changes that make it more modular. One of those changes is that environment-based configuration is now built-in. The biggest benefit of this new configuration system is that it’s not based on System.Configuration or web.config. Instead, it pulls from an ordered set of configuration providers that support a variety of file formats (such as XML and JSON) as well as environment variables. If one of the built-in configuration providers doesn’t meet your needs, you can write your own.

https://scottdorman.blog/2016/03/19/integrating-asp-net-core-configuration-in-mvc-4/

Copy link

Thank you for this article. Saved a lot of time for me.
I have one question.
In my project, I am using appsetting.json and have wired that up with ConfigurationBuilder().AddJsonFile("appsettings.json") but I also need to access some of its variables in my startup class itself to configure my app with some authentication.
How can I access configuration values in my startup class?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants