I'm working on a project where we make extensive use Razorhost scripts that make several simultaneous API calls to Dnn.
The developers, when debugging locally sometimes encountered a unknown error.
Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
[NullReferenceException: Object reference not set to an instance of an object.]
System.Web.Http.WebHost.HttpControllerHandler.EndProcessRequest(IAsyncResult result) +159
System.Web.CallHandlerExecutionStep.OnAsyncHandlerCompletion(IAsyncResult ar) +282
We ignored the problem because we didn't have the issue on the staging server.
But immediately after having moved the VM of the staging server to a much faster host machine we are having this issue also on staging. Meaning: now also the customer sees them. Meaning now I really have to find/fix it.
But I need new inspiration to tackle it because I already did everything possible that I can think of.
- The main problem is: I can't reproduce it at will. I have to wait patiently to gather more information from logging. But no luck so far.
- I've searched the internet for "NullReferenceException EndProcessRequest" and stumbled on some DNN posts. Indicating that i'm on the right track ;-)
- Most promising posts where these
>>Always use request.CreateResponse() instead of using new HttpResponseMessage. [...] If you are using new, make sure you set the RequestMessage property.
The fact that Dotnetnuke.Web.Api has some code mentioned as a fix, makes me thing that Charles Nurse also read/knowns this. He might even have encountered the error?
Any tips or questions or remarks that inspire me on how to proceed next would be most welcome.