Problems setting up an ASP.NET MVC site on IIS7 w/ Nhibernate

Posted by Brandon on Stack Overflow See other posts from Stack Overflow or by Brandon
Published on 2010-04-29T02:10:53Z Indexed on 2010/04/29 2:17 UTC
Read the original article Hit count: 402

When deploying my published website to the host (Its a shared hosting plan) I get this error:

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

I found this question which describes my problem, but I'm not initializing NHibernate in Application_Start, it is already being done in Init.

The only other cause of this error I can find is that the Global.asax file is inheriting from a class other than HttpApplication, but I'm not doing that either. This is pretty much the Global.asax file

protected void Application_Start()
{
    AreaRegistration.RegisterAllAreas();

    RegisterRoutes(RouteTable.Routes);
}

public override void Init()
{
    base.Init();

    if (_wasNHibernateInitialized)
        return;

    // Initialize NHibernate

    // Other setup like the StructureMap initialization
}

Is there any other reason why an ASP.NET MVC application would give this error when being deployed to IIS7?

© Stack Overflow or respective owner

Related posts about asp.net-mvc

Related posts about publishing