ASP.NET MVC 2应用程序在VS中运行但IIS上出现错误

ser*_*geb 3 iis-7 iis-7.5 asp.net-mvc-2

我们继承了在Visual Studio中运行的MVC 2应用程序但是当我们尝试将它部署到生产服务器(Win 2008 x86)或者甚至是同一个本地Win7 x64机器但是使用IIS时,两者上的AppPool都是ASP.NET 4.0 w/Integrated模式,我们得到相同的NullReferenceException错误:

    Server Error in '/' Application.
--------------------------------------------------------------------------------

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: 

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.  

Stack Trace: 

[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
   System.Web.HttpApplication.BeginProcessRequestNotification(HttpContext context, AsyncCallback cb) +132
   System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +709

--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1 
Run Code Online (Sandbox Code Playgroud)

有人经历过这个吗?任何建议表示赞赏.

谢谢!

Dar*_*rov 7

我能想到的一个可能原因是,应用程序托管在集成模型中,HttpContext不可用Application_Start.因此,如果您的应用程序试图访问HttpContext,请求,响应,...它可能会抛出此.