Error deploying ASP.NET MVC NHibernate application for IIS7

I have an ASP.NET MVC application that runs on a vs .net development web server. When I publish in IIS7, I get the following error. I spent many hours and still no solution!

 [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

Here is Application_Start

protected void Application_Start()
        {


                ConfigureLogging();


                ComponentRegistrar.RegisterComponents();


                NHibernateSession.InitSqlServer2005(new WebSessionStorage(this), Settings.Default.DefaultConnString);


                CacheManager.InitCaches();

            }
        }

I'm late for this app and don't know the best practices of MVC and NHibernate

+3
source share
2 answers

You cannot configure nhibernate at application startup. I don’t know exactly why, but I also had this problem.

You can initialize it in Init (). You can also see it being done here http://code.google.com/p/sharp-architecture/source/checkout

+5

nhibernate Application_Start() Init() , . . , , , jbland. nhibernate .

, , WebSessionStorage. - Init().

+1

Source: https://habr.com/ru/post/1707625/


All Articles