(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:
[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. It only happens at my own laptop, not on a stage or live server where the same asp.net mvc application is running
I already checked:
I'm using an app pool in Integrated mode on .net CLR version 4.0.30319 Target framework is .Net 4.5.2
my global.asax looks like this:
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.
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.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.