Yes thanks it’s quite plain to me that System.Web.HttpContext.Current has nothing to do with ServiceStack but therefore I wonder that if we change only the ServiceStack dependencies version to 5.4.0 to get such an issue? I will test it again with a small AppHost…or do you have another idea why this happens?
I don’t know why you’re seeing the issue, reasons why it would be null would be because it’s not a System.Web app or that access is not being done within the context of a HTTP Request (e.g in a background Thread).
But I wouldn’t be accessing the context via the singleton when you have access to IRequest, resolve it from OriginalRequest instead.
No you can’t access the same IRequest instance via a singleton, you can create a new IRequest instance with the .ToRequest() extension method but it wont have access to any custom items you’ve added in IRequest.Items collection.
For non-HTTP Services like MQ you can use BasicRequest() which is effectively an empty IRequest instance.