This is the strangest thing I have seen in awhile. I created 2 solutions. Both where created identically.
I removed the WeatherController
and added a HealthController
in both.
[Route("api/[controller]")]
[ApiController]
public class HealthController : ControllerBase
{
[HttpGet]
public string Get()
{
return $"Mobile Server {Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT")}";
}
}
Is so simple, yet if I run the project in IISExpress, I get a 500.19 Error when I try to access the route from a browser.
If I run it in Kestrel, everything works just fine. Also, if I change the word api in the route to anything else, it also works just fine.
In my second solution, I am not having any issues at all.
I'm totally confused...