C#C
C#3y ago
Tiltyboi

C# IConfiguration not loading appsettings

Anyone knows why my appsettings isnt found?
It exists in the same project in my solution as i run?
Its a simple console application with my appsettings.json in it but its not found?
var builder = new ConfigurationBuilder()
              .AddJsonFile("appsettings.json", true, true)
              //.AddUserSecrets<Program>()
              .AddEnvironmentVariables();
            _config = builder.Build();

But when i user User Secrets it works fine.
Was this page helpful?