meta4
meta4

Reputation: 736

.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.

Upvotes: 7

Views: 8410

Answers (1)

Tandi Sunarto
Tandi Sunarto

Reputation: 251

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

Upvotes: 13

Related Questions