projet Web ASP.NET MVC 3 Mon fonctionnait très bien, je recompilé et maintenant je reçois cette erreur (certains chemins et espaces de noms changés pour protéger les innocents):NullReferenceException sur RouteTable.Routes
Object reference not set to an instance of an object. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
Source Error:
Line 66:
RouteTable.Routes.MapRoute(Line 67:
"DefaultRoutes", // Route name Line 68:
"{module}/{controller}/{action}/{id}", // URL with parametersSource File: ....\Global.asax.cs
Line: 66Stack Trace:
[NullReferenceException: Object reference not set to an instance of an object.]
Project.MvcApplication.RegisterRoutes(RouteCollection routes) in D:.....\Global.asax.cs:66 Project.MvcApplication.Application_Start() in D:.....\Global.asax.cs:139[HttpException (0x80004005): Object reference not set to an instance of an object.]
System.Web.HttpApplicationFactory.EnsureAppStartCalledForIntegratedMode(HttpContext context, HttpApplication app) +4051717 System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +191
System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +352 System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +407 System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +375[HttpException (0x80004005): Object reference not set to an instance of an object.]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +11642112
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +141
System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +4865877
J'utilise IIS7.5 sous Windows 7 x64 et le pool d'applications est configuré pour s'exécuter avec .NET 4 et le pipeline géré 'Integrated'.
J'ai essayé de redémarrer et de nettoyer les dossiers bin et obj sans succès.
Quelques informations supplémentaires qui se révèle être important - la ligne manquante de la page d'erreur ci-dessus:
RouteTable.Routes.MapRoute(
"DefaultRoutes", // Route name
"{module}/{controller}/{action}/{id}", // URL with parameters
new { module = _loadedModules.FirstOrDefault().Name, controller = "Home", action = "Index", id = UrlParameter.Optional } // Parameter defaults
);
pouvez-vous poster vos itinéraires? ça peut aider un peu ... –