Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

.NET Core 2.1 ConfigurationBuilder.Build() - StackOverflowException

I've installed VS 2017 Preview and 2.1.300-preview2-008530 SDK. Now, in my Web Application project following sequence generates StackOverflowException:

var builder = new ConfigurationBuilder()
                            .SetBasePath(env.ContentRootPath)
                            .AddJsonFile("appsettings.json");

NET Core 2.1 Preview 2 Known Issues - does not contain anything related to my problem.

like image 748
meta4 Avatar asked Apr 15 '18 11:04

meta4


1 Answers

Add this package Microsoft.Extensions.Configuration.json

I ran into the same issue after upgrading to 2.1 and found this answer on microsoft online doc

https://learn.microsoft.com/en-us/aspnet/core/fundamentals/configuration/?view=aspnetcore-2.1&tabs=basicconfiguration

like image 188
Tandi Sunarto Avatar answered Nov 15 '22 17:11

Tandi Sunarto