0

My code is exactly the same as the code presented in this StackOverflow question(but fixed). The code runs fine in a standalone Web API project but when I add the same ASP.NET Core Web API project in a Service Fabric project template and run it on local cluster, _mySettings is always null. Is there something that I am missing here? I am using Options<type> approach. I can confirm that the Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT") evaluates to "Development", in my HomeController code.

The project targets .NET Core 3.1.

user419022
  • 71
  • 1
  • 1
  • 4

1 Answers1

0

I still don't know the reason why it doesn't work by default in a project which is newly created from Visual Studio solution template but This StackOverflow answer fixed my issue.

user419022
  • 71
  • 1
  • 1
  • 4