[英]NullReferenceException at System.Web.Mvc.FilterProviderCollection.GetFilters
[英]After reboot: NullReferenceException at System.Web.PipelineStepManager.ResumeSteps
(幾乎)每天早上,在啟動我的筆記本電腦,啟動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
在iisreset之后,這個問題就解決了。 它只發生在我自己的筆記本電腦上,而不是在運行相同的asp.net mvc應用程序的舞台或現場服務器上
我已經檢查過:
我在.net CLR版本4.0.30319上使用集成模式的應用程序池。目標框架是.Net 4.5.2
我的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) {
....
}
}
}
在看了互聯網上的錯誤后,我認為你有兩個選擇。
看看這是否有效。
此外,您是否為任何其他項目收到此錯誤,或者創建新項目並檢查出來? 如果是,那么可能重新安裝IIS將解決這個問題。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.