question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

System.NullReferenceException at Microsoft.AspNetCore.Http.DefaultHttpRequest.get_HasFormContentType()

See original GitHub issue

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

Sometime I got the error System.NullReferenceException at Microsoft.AspNetCore.Http.DefaultHttpRequest.get_HasFormContentType() for several GET API.

Expected Behavior

No response

Steps To Reproduce

No response

Exceptions (if any)

Error: Object reference not set to an instance of an object.System.NullReferenceException: Object reference not set to an instance of an object.
at Microsoft.AspNetCore.Http.DefaultHttpRequest.get_HasFormContentType()
at Microsoft.AspNetCore.Mvc.ModelBinding.FormValueProviderFactory.CreateValueProviderAsync(ValueProviderFactoryContext context)
at Microsoft.AspNetCore.Mvc.ModelBinding.CompositeValueProvider.CreateAsync(ActionContext actionContext, IList`1 factories)
at Microsoft.AspNetCore.Mvc.ModelBinding.CompositeValueProvider.TryCreateAsync(ActionContext actionContext, IList`1 factories)
at Microsoft.AspNetCore.Mvc.Controllers.ControllerBinderDelegateProvider.<>c__DisplayClass0_0.<<CreateBinderDelegate>g__Bind|0>d.MoveNext()

.NET Version

6.0.202

Anything else?

No response

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:15 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
davidfowlcommented, Jun 8, 2022

OK here’s the deal:

  • I won’t be able to help you diagnose the problem unless I have access to the source and or dumps.
  • If you’re running on windows, you might be able to use debug diag to get a crash dump when this happens
  • If you’re on Linux there are other ways but they are harder.

Read the other issue and see what the issue was and what the fix was. That will help you narrow your code down to what parts of your code might be a problem. It could be logger, direct usage of the telemetry client or indirect usage.

0reactions
msftbot[bot]commented, Jun 13, 2022

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment. If it is closed, feel free to comment when you are able to provide the additional information and we will re-investigate.

See our Issue Management Policies for more information.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Random NullReferenceException on Asp.Net Core 2.1.1 ...
System.NullReferenceException: at Microsoft.AspNetCore.Http.Internal.DefaultHttpRequest.get_Query (Microsoft.AspNetCore.
Read more >
System.NullReferenceException: 'Object reference not set ...
Can someone please have a look at my code and help me understand why I'm getting this error? I have set up a...
Read more >
System.NullReferenceException while trying to load a view
I am trying to load DataMgmt.cshtml view by clicking on a link from my _Layout page but the page which should be loaded...
Read more >
How can I fix the error: System.NullReferenceException
How can I fix the error: System.NullReferenceException: 'Object reference not set to an instance of an object.'.
Read more >
Why am I getting a null reference exception for ASP.NET ...
Model Binding Null exception a View Component in Razor Pages Framework : ASP.Net Core 3.1. Razor page. 1) AppView Page -> ApplicantsView.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found