简体   繁体   English

重启后:System.Web.PipelineStepManager.ResumeSteps中的NullReferenceException

[英]After reboot: NullReferenceException at System.Web.PipelineStepManager.ResumeSteps

(Almost) every morning, after booting my laptop, starting IIS, and browsing to a specific asp.net mvc web application on my PC, I get this exception: (几乎)每天早上,在启动我的笔记本电脑,启动IIS,并在我的PC上浏览到特定的asp.net mvc Web应用程序后,我得到以下异常:

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

After iisreset, this is solved. 在iisreset之后,这个问题就解决了。 It only happens at my own laptop, not on a stage or live server where the same asp.net mvc application is running 它只发生在我自己的笔记本电脑上,而不是在运行相同的asp.net mvc应用程序的舞台或现场服务器上

I already checked: 我已经检查过:

  • I didn't add any custom eventhandlers in my global.asax 我没有在global.asax中添加任何自定义事件处理程序
  • I have no custom HTTPModules of my own. 我没有自己的自定义HTTPModules。 I do use ImageResizer, but no eventhandlers are defined for that module (that I'm aware of and can be seen in the code). 我确实使用ImageResizer,但没有为该模块定义事件处理程序(我知道并且可以在代码中看到)。
  • I did try to move the code from Application_BeginRequest to the global.Asax constructor but ran into another issue because in the constructor I don't have any HttpContext.Current yet. 我确实尝试将代码从Application_BeginRequest移动到global.Asax构造函数但遇到了另一个问题,因为在构造函数中我还没有任何HttpContext.Current。
  • (I know what a NullReferenceException means, so no need to explain that. In this case the exception isn't thrown by my own code.) (我知道NullReferenceException是什么意思,所以不需要解释它。在这种情况下,我的代码不会抛出异常。)

I'm using an app pool in Integrated mode on .net CLR version 4.0.30319 Target framework is .Net 4.5.2 我在.net CLR版本4.0.30319上使用集成模式的应用程序池。目标框架是.Net 4.5.2

my global.asax looks like this: 我的global.asax看起来像这样:

public class MvcApplication : HttpApplication {

        protected void Application_Start() {
            AreaRegistration.RegisterAllAreas();
            GlobalConfiguration.Configure(WebApiConfig.Register);
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
            RouteConfig.RegisterRoutes(RouteTable.Routes);
            BundleConfig.RegisterBundles(BundleTable.Bundles);

            ModelBinders.Binders.Add(typeof(DateTime), new DateTimeModelBinder());
            ModelBinders.Binders.Add(typeof(DateTime?), new NullableDateTimeModelBinder());

            ClientDataTypeModelValidatorProvider.ResourceClassKey = "ValidationMessages";
            DefaultModelBinder.ResourceClassKey = "ValidationMessages";
        }

        protected void Application_BeginRequest(object sender, EventArgs e) {
            CultureInfo ci = new CultureInfo(LanguageHelpers.GetUserCultureName());
            System.Threading.Thread.CurrentThread.CurrentUICulture = ci;
            System.Threading.Thread.CurrentThread.CurrentCulture = ci;
        }

        public void Application_Error(object sender, EventArgs e) {
            if (!Request.IsLocal) {

....

            }
        }
    }

After taking look at error on internet, i think you have two option. 在看了互联网上的错误后,我认为你有两个选择。

  1. Remove all HTTP Module if any added in your system. 删除系统中添加的所有HTTP模块。
  2. Remove IIS from Control panel --> Programs & Feature --> Turn off/on Window Feature Remove Internet Information Services and reboot and install again. 从控制面板中删除IIS - >程序和功能 - >关闭/打开窗口功能删除Internet信息服务并重新启动并重新安装。

See if this works or not. 看看这是否有效。

Also, do you getting this error for any other project or maybe create new one and check this out? 此外,您是否为任何其他项目收到此错误,或者创建新项目并检查出来? If yes then probably reintalling IIS will fix this. 如果是,那么可能重新安装IIS将解决这个问题。

Server error '/' Application. 服务器错误'/'应用程序。 - HttpException - HttpException

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 System.Web.Mvc.FilterProviderCollection.GetFilters上的NullReferenceException - NullReferenceException at System.Web.Mvc.FilterProviderCollection.GetFilters 系统重启后,Ignite缓存变为空 - Ignite cache becomes empty after system reboot 在数据库操作返回System.NullReferenceException后更新组合框 - Updating Combobox after database operations returns `System.NullReferenceException` 在处理 HwndSource 后调用 close() on window 导致 System.NullReferenceException - After Disposing HwndSource calling close() on window leads to System.NullReferenceException App_Web _ ***。dll中出现“System.NullReferenceException”类型的异常 - An exception of type 'System.NullReferenceException' occurred in App_Web_***.dll C#。 运行MSTest测试后引发System.NullReferenceException - C#. System.NullReferenceException thrown after running MSTest tests C#SSL流-系统重启后证书错误 - C# SSL stream - certificate error after system reboot System.NullReferenceException:System.Web.Mvc.WebViewPage<t> .Model.get 返回 null</t> - System.NullReferenceException: System.Web.Mvc.WebViewPage<T>.Model.get returned null 检查system.nullreferenceException - Check system.nullreferenceexception System.NullReferenceException:EveAI - System.NullReferenceException: EveAI
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM