Your question has been submitted and is awaiting moderation.
Thank you for reporting this content, moderators have been notified of your submission.
I have built several web api services within DNN. The services seem to be working pretty good, with a couple of exceptions. The main one is that periodically, one of the calls to the services will throw one of these 3 errors:
Exception type: KeyNotFoundException
Exception message: The given key was not present in the dictionary.
at System.Web.Http.WebHost.HttpControllerHandler.EndProcessRequest(IAsyncResult result)
at System.Web.HttpApplication.CallHandlerExecutionStep.OnAsyncHandlerCompletion(IAsyncResult ar)
Exception type: NullReferenceException
Exception message: Object reference not set to an instance of an object.
at System.Web.Http.WebHost.HttpControllerHandler.EndProcessRequest(IAsyncResult result)
at System.Web.HttpApplication.CallHandlerExecutionStep.OnAsyncHandlerCompletion(IAsyncResult ar)
Exception type: ArgumentException
Exception message: An item with the same key has already been added.
at System.Web.Http.WebHost.HttpControllerHandler.EndProcessRequest(IAsyncResult result)
at System.Web.HttpApplication.CallHandlerExecutionStep.OnAsyncHandlerCompletion(IAsyncResult ar)
It is completely random. It happens on all the services and it is VERY rare. I will have 500 calls to the same service, and only one of them will produce this error. Nothing I am seeing is indicating that the problem is with my code. It seems that the issue is somehow with the Web Api sub system itself or within DNN's Web Api wrapper.
Has anyone seen anything like this themselves?