My question is simple. I have an ASP.net core 3.0 app, I added secrets using visualstudio and pasted my secrets into the secret file normally. Then inside my Program.cs, I added a call to addusersecrets as follows:
...
...
.AddUserSecrets<Startup>()
But while calling my secrets like Configuration["Authentication:Secret"]
as I used to do when it was in appsettings.json, I get a null value in return.
I went through stackoverflow and tried solutions like changing my addsecrets as follows:
.AddUserSecrets("fds...-...-...askd")
//OR
.AddUserSecrets(typeof(Startup).Assembly, true, reloadOnChange: true)
BUt none of then works.
I wonder if this secret stuff even works on asp.net core, because I don't see any reason my code doesn't work. please if someone gets it, can you tell me a solution ? Thanks.