MVC example and IIS 7 integrated mode

Apr 7, 2009 at 7:41 PM
Hi,

I'm having problems with running the MVC example using IIS 7 integrated mode on 64-bit Vista Ultimate.  The example runs fine with the ASP.NET development server and on other machines here running IIS 6.  The problem seems to occur in the Application_Start method in Global.asax.cs with the line:

EventBroker.Instance.Attach(this);
If I comment out that line, it will run.

The error being displayed is:

[NullReferenceException: Object reference not set to an instance of an object.]
   System.Web.PipelineModuleStepContainer.GetStepArray(RequestNotification notification, Boolean isPostEvent) +27
   System.Web.PipelineModuleStepContainer.GetEventCount(RequestNotification notification, Boolean isPostEvent) +10
   System.Web.PipelineStepManager.ResumeSteps(Exception error) +202
   System.Web.HttpApplication.BeginProcessRequestNotification(HttpContext context, AsyncCallback cb) +91
   System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +508
Coordinator
Apr 7, 2009 at 7:56 PM
The released version contains a bug. Try changing into this:

protected void Application_Start(object sender, EventArgs e)

 

{

 

// normally the engine is initialized by the initializer module but it can also be initialized this programmatically

 

 

// since we attach programmatically we need to associate the event broker with a http application

 

IEngine engine = N2.Context.Initialize(

false);

 

RegisterRoutes(RouteTable.Routes, engine);

}

 

public override void Init()

 

{

EventBroker.Instance.Attach(

this);

 

 

base.Init();

 

}

Apr 7, 2009 at 8:33 PM
Thanks,

I received a different error when I only made the above change, but I just checked out N2 from SVN and it works now.