IIS 10.0, VS 2022, .NET Framework 4.7.2 Web API
I inherited a web api application that I am told worked 100% the last time it was published (at least a year ago, maybe 2). However, now I get 404 not found when the attribute contains a period (both in IDE using IIS and when published to IIS on server).
I tried creating a new web api app with 2 methods:
[HttpPost]
[Route("BatchData/ProcessResponseByString/{requestId}")]
public HttpResponseMessage ProcessResponseByString(string requestId)
{
return new HttpResponseMessage()
{
Content = new StringContent($"String:{requestId}")
};
}
[HttpPost]
[Route("BatchData/ProcessResponseByDouble/{requestId:double}")]
public HttpResponseMessage ProcessResponse(double requestId)
{
return new HttpResponseMessage()
{
Content = new StringContent($"Double:{requestId}")
};
}
These urls work: https://localhost:44352/BatchData/ProcessResponseByString/12345 https://localhost:44352/BatchData/ProcessResponseByDouble/12345
These urls fail with 404 not found: https://localhost:44352/BatchData/ProcessResponseByString/12345.67 https://localhost:44352/BatchData/ProcessResponseByDouble/12345.67
Perhaps an IIS upgrade changed the way routing is resolved in IIS?
Any ideas on how to resolve this?
Thanks.