Not sure what could cause this.
First step is trying to identify it, hopefully by finding the StackTrace of the Exception. The /favicon.ico Exception is likely coming from MVC where it tries to match a controller with the automated browser requests for favicon.ico.
Does the HTTP Header include a X-Powered-By: ServiceStack/...
Header? If not the Request may not be handled by ServiceStack. Are any IIS Exceptions being reported in the Windows Event Viewer or in the IIS Logs?
Do you have any logging enabled? and does it contain any Exception StackTraces that could cause this?
Can you catch the Exception with a registered UncaughtExceptionHandlers?
public override void Configure(Container container)
{
//Handle Unhandled Exceptions occurring outside of Services
//E.g. Exceptions during Request binding or in filters:
this.UncaughtExceptionHandlers.Add((req, res, operationName, ex) => {
res.Write($"Error: {ex.GetType().Name}: {ex.Message}");
res.EndRequest(skipHeaders: true);
});
}
The very first callback ServiceStack executes at the start of the pipeline is the RawHttpHandlers
, can you try put a debug breakpoint to check if it’s getting called:
RawHttpHandlers.Add(httpReq => {
Console.WriteLine("In RawHttpHandlers");
return null;
});
If not then the Request isn’t being reaching ServiceStack, maybe you have a conflict with your ASP.NET Handler registrations.
The next callback executed before deserializing the request is PreRequestFilters
:
PreRequestFilters.Add((req,res) => {
Console.WriteLine("In PreRequestFilters");
});
After that the request is deserialized it will execute the GlobalRequestFilters
:
GlobalRequestFilters.Insert(0, (req, res, dto) => {
Console.WriteLine("In GlobalRequestFilters");
});
Can you let me know how far the request reaches?