I’m not able to reproduce this, I’ve created a new ServiceStack MVC5 project in VS.NET and changed the Hello Service to return the Absolute URI:
public class MyServices : Service
{
public object Any(Hello request)
{
return new HelloResponse {
Result = $$"Hello, {request.Name}!",
AbsoluteUri = request.ToAbsoluteUri()
};
}
}
Which for http://localhost:49928/api/hello.json
returns:
{
"Result": "Hello, !",
"AbsoluteUri": "http://localhost:49928/api/hello"
}
and for http://localhost:49928/api/hello/world.json
returns:
{
"Result": "Hello, world!",
"AbsoluteUri": "http://localhost:49928/api/hello/world"
}
Did you start from one of the templates otherwise did you follow the MVC Integration docs, you can find a working ServiceStack + MVC configuration in the MVC 5 Project Template.