You can install the following two NuGet packages:
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Configuration.Binder;
And then you’ll have the possibility to use the following extension method:
var myArray = _config.GetSection("MyArray").Get<string[]>();
More Related Contents:
- How do you create a custom AuthorizeAttribute in ASP.NET Core?
- Increase upload file size in Asp.Net core
- Resolving instances with ASP.NET Core DI from within ConfigureServices
- ASP.NET Core Dependency Injection error: Unable to resolve service for type while attempting to activate
- How do I get client IP address in ASP.NET Core?
- How to read ASP.NET Core Response.Body?
- Timeouts with long running ASP.NET MVC Core Controller HTTPPost Method
- How to get a list of all routes in ASP.NET Core?
- How to update values into appsetting.json?
- How do I access Configuration in any class in ASP.NET Core?
- Render Razor View to string in ASP.NET Core
- Unable to create migrations after upgrading to ASP.NET Core 2.0
- ASP.NET Core 2.0 disable automatic challenge
- How to get the Development/Staging/production Hosting Environment in ConfigureServices
- How to add IHttpContextAccessor in the Startup class in the DI in ASP.NET Core 1.0?
- Convert IHtmlContent/TagBuilder to string in C#
- Dependency Injection error: Unable to resolve service for type while attempting to activate, while class is registered
- Unable to resolve service for type while attempting to activate
- How to get user Browser name ( user-agent ) in Asp.net Core?
- Dependency injection, inject with parameters
- ASP.Net Core MVC – Client-side validation for custom attribute
- Injection of IUrlHelper in ASP.NET Core
- Bind Dictionary with list in viewmodel to checkboxes
- How to return HTTP 500 from ASP.NET Core RC2 Web Api?
- How to stream with ASP.NET Core
- ‘HttpPostedFileBase’ in Asp.Net Core 2.0
- How to implement a “pure” ASP.NET Core Web API by using AddMvcCore()
- Dealing with large file uploads on ASP.NET Core 1.0
- Sharing Cookies Between Two ASP.NET Core Applications
- ASP.NET 5 Authorize against two or more policies (OR-combined policy)