System.NullReferenceException: at Microsoft.AspNetCore.Http.DefaultHttpRequest.set_RouteValues #26109
Unanswered
ramkumars9688
asked this question in
General
Replies: 1 comment 8 replies
-
That's usually caused by some bad async calls in the stack, like using async void, or not awaiting a task. Can you share the code for the custom middleware in the stack trace? |
Beta Was this translation helpful? Give feedback.
8 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
App Version: Asp.Net Core 3.1
Hosted in Azure App service.
Null reference at Router middleware is thrown intermittently. I tried to replicate but no luck.
Based on my analysis with Debug snapshot, I could see the exception reported endpoint and the request path in the httpContext is different. Not sure if this is related to this.
For e.g, Null reference exception is reported at 'api/ABC' but when I look at the snapshot of exception, it has the route as 'api/DEF'.
The exception call stack for reference:
Any help to identify the root cause would be appreciated.
Thanks,
Ram
Beta Was this translation helpful? Give feedback.
All reactions