0

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...

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
  • Can you check your config file ? – xav-stargate May 08 '21 at 03:50
  • When I got this error in the past it tended to be an issue with the configuration of the module in the IIS (usually in combination with a missing URL rewrite module). You might want to take a look at this question with the accepted answer: https://stackoverflow.com/questions/11305821/iis-http-error-500-19 – SJP May 08 '21 at 05:28

0 Answers0