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.

NullReferenceException thrown by IISHttpContext.AbortIO in ASP.NET Core 3.0.1

See original GitHub issue

Describe the bug

From a weekly review of our production error logs, we noticed a single isolated example of the following exception from an ASP.NET Core 3.0.1 app running on Windows Server 2016 with IIS in-process hosting:

System.NullReferenceException: Object reference not set to an instance of an object.
   at Microsoft.AspNetCore.Server.IIS.Core.IISHttpContext.AbortIO(Boolean clientDisconnect)
   at Microsoft.AspNetCore.Server.IIS.Core.IISHttpServer.OnDisconnect(IntPtr pvManagedHttpContext)

To Reproduce

Unknown - presumably some edge-case when the client disconnects.

From looking at the code, I’d guess that somehow _bodyOutput was null.

https://github.com/aspnet/AspNetCore/blob/22dedcb2f0de59022e0383e1f05c9caffc708522/src/Servers/IIS/IIS/src/Core/IISHttpContext.IO.cs#L216

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:46 (20 by maintainers)

github_iconTop GitHub Comments

16reactions
bhrugencommented, Mar 19, 2020

I am also facing this error quote often! My project is in .net core 3.1

2reactions
BrennanConroycommented, Jun 11, 2020
Read more comments on GitHub >

github_iconTop Results From Across the Web

IISHttpServer OnDisconnect NullReferenceException
NET Core web application that is primarily based on executing Endpoints, I frequently get a NullReferenceException on the AbortIO call ...
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 >
Migrate from ASP.NET Core 2.2 to 3.0
This article explains how to update an existing ASP.NET Core 2.2 project to ASP.NET Core 3.0. It might be helpful to create a...
Read more >
Issues with System.NullReferenceException occurrence ...
NET Core 3.1 is breaking when starting the web application because of a NullReferenceException, but this one is thrown in the IISHttpServer.
Read more >
Friends Don't Let Friends Swallow NullReferenceException
If you are using ASP.NET MVC, Core or non-Core, chances are you are swallowing NullReferenceException without you even noticing.
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