NullReferenceException in PipelineStepManager.ResumeSteps

Since I have changed my hosting to ASP.NET 4.0 Web Form and IIS7 Integrated Mode, my website usually has the below error:

[NullReferenceException: Object reference not set to an instance of an object.] System.Web.PipelineStepManager.ResumeSteps(Exception error) +197 System.Web.HttpApplication.BeginProcessRequestNotification(HttpContext context, AsyncCallback cb) +89 System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +189

However, the website works fine. How can I fix this problem?

As Gisli Konrao posted, in a comment, it is due to the fact that you have a custom event handler wired up in the ASP.NET MVC 4 application.

In my case, I had:

this.BeginRequest += new EventHandler(MvcApplication_BeginRequest);

After commenting out this statement, the problem was fixed (ASP.NET wires up these events on the background, so just defining it will make it work).

NullReferenceException thrown from System.Web , [NullReferenceException: Object reference not set to an instance of an object.] System.Web.PipelineStepManager.ResumeSteps(Exception  [NullReferenceException: Object reference not set to an instance of an object.] System.Web.PipelineStepManager.ResumeSteps(Exception error) +1781 System.Web

I solved this by moving my BeginRequest event observer hook-up code into the Global.asax (MvcApplication) constructor.

I also filed another connect bug since a similar one was closed as not reproducible, yet this error seems to be all over forums on the web.

https://connect.microsoft.com/VisualStudio/feedback/details/788481/iis-express-with-vs2012-null-ref-when-attaching-handler-to-httpapplication-beginrequest

A null ref is never right. We shouldn't see null refs from an MS API.

NullReferenceException on PipelineModuleStepContainer after , [NullReferenceException: Object reference not set to an instance of an PipelineStepManager.ResumeSteps(Exception error) +251 System. NullReferenceException in PipelineStepManager.ResumeSteps (4) As Gisli Konrao posted, in a comment, it is due to the fact that you have a custom event handler wired up in the ASP.NET MVC 4 application.

Put the code for wiring up the events and initialization stuff in an overridden Init() method of the HttpApplication class. That's supposed to fire after the essential ASP.NET things are all setup.

null refererence exception on , [NullReferenceException: Object reference not set to an instance of an PipelineStepManager.ResumeSteps(Exception error) +145 System. NullReferenceException thrown from System.Web.PipelineStepManager.ResumeSteps on Win2008 Server / IIS7 RSS 2 replies Last post Aug 07, 2010 02:46 PM by rashadrivera2

Do you have any custom HttpModules in your application? This happened to me when I had and HttpModule adding application events on Init. Try disabling your custom HttpModule and see if you application gets past this point. If it does, then it's because of the difference between how HttpModule work in .Net 3.5 and .Net 4.0.

Website suddenly stopped working, Exception type: NullReferenceException Exception message: Object PipelineStepManager.ResumeSteps(Exception error) at System.Web. Web resources about - NullReferenceException thrown from System.Web.PipelineStepManager.ResumeSteps on Win2008 Server / IIS7 - asp.net.config-deploy multi-device-hybrid-apps Q&A for professional and enthusiast programmers

(CLOSED) Intermittent runtime error on our website after, [NullReferenceException: Object reference not set to an instance of an object.] PipelineStepManager.ResumeSteps(Exception error) +984 [NullReferenceException: Object reference not set to an instance of an object.] System.Web.PipelineModuleStepContainer.GetEventCount(RequestNotification notification, Boolean isPostEvent) +30 System.Web.PipelineStepManager.ResumeSteps(Exception error) +266

No RSVP required: MvcApplication_BeginRequest and , Czy masz jakieś niestandardowe HttpModules w swojej aplikacji? Zdarzyło mi się to, gdy miałem i HttpModule dodawanie zdarzeń aplikacji na Init. Spróbuj  But when i try to run the app on IIS7 i get a NullReferenceException: +30 System.Web.PipelineStepManager.ResumeSteps(Exception error) +1112 System.Web

Unexpected error after enabling HTTPS on a webapplication for , We've been tracking down a difficult memory leak in our web application. We discovered that the memory leak started to occur after we upgraded CCR from 2.0.831.0 to 2.0.913.0

Comments
  • Did you manage to solve this problem?
  • Anyone solve this problem? I'm seeing this: System.NullReferenceException: Object reference not set to an instance of an object. at System.Web.HttpApplication.PipelineStepManager.ResumeSteps(Exception error) at System.Web.HttpApplication.CallHandlerExecutionStep.OnAsyncHandlerCompletion(IAsyncResult ar) at System.Threading.Tasks.Task.Execute() --- End of inner exception stack trace ---
  • when using Windows Authentication, in my case and adding this: this.AuthenticateRequest += vcApplication_AuthenticateRequest;
  • This was the correct fix for me. I had event handlers (for logging purposes) in Application_Start; moving them to Init fixed it.
  • Thank for your answer Gisli, I had removed all HttpModule from my project by it still not solve. Finally, I changed IIS from Integrated to Classic and change routing URL to have extension (.aspx) now it work fine.
  • are you doing something similar to this then: forums.asp.net/t/1327102.aspx/1 ? (Setting application level events programatically on Application Start instead of just creating functions called Application_<EventName> in your Application class)