I have a net5.0 app with ServiceStack 5.14 running in Visual Studio Professional 2022.
Routes are getting defined like this in a Apphost.cs
public override RouteAttribute[] GetRouteAttributes(Type requestType)
{
var routes = base.GetRouteAttributes(requestType);
routes.Each(x => x.Path = “/api” + x.Path);
return routes;
}
Giving us a ServiceStack RouteAttribute.paths like “/api/things” … all good, as expected.
But if I run it in VS and request http://localhost:64200/api/things I get an Http 405 and a “NotImplementedException”
And if I request http://localhost:64200//api/things (Note the ‘//’ after the port) it works HTTP 200. Sadly not expected and breaks my client. 8¬(
Any ideas what maybe causing this? I’m inheriting this code and I am unfamiliar with ServiceStack. The services route as expected in production but not in dev. Makes me wonder if it is a Visual Studio feature, but it does not happen for other netcore apps without ServiceStack …