sundryoss / Sundry.PollyDemystified

2 stars 1 forks source link

Compile error appsettings.json was not found #1

Closed charring closed 1 year ago

charring commented 1 year ago

When building API project

System.IO.FileNotFoundException: 'The configuration file 'appsettings.json' was not found and is not optional. The expected physical path was 'C:\shufflepoint\test\sundryoss\Sundry.PollyDemystified\src\Sundry.PollyDemystified.Api

anktsrkr commented 1 year ago

Hi @charring Thanks for raising issue. I intentionally ignored appsettings file. However i see the problem and I fixed it. The solution should be working now, provided you have configured the auth0 correctly.

charring commented 1 year ago

Looking at https://auth0.com/blog/securing-aspnet-minimal-webapis-with-auth0

They have in the appconfig.json (following your example)

"Domain": "xx.eu.auth0.com/"

And in Program.cs

c.Authority = $"https://{builder.Configuration["Auth0:Domain"]}";

So FIY you may want to verify your settings.