riteshrao / ncommon

A framework for implementing commonly used design patterns when using Domain Driven Design
www.codeinsanity.com
218 stars 61 forks source link

Trouble boostrapping Session storage #7

Open dplaskon opened 14 years ago

dplaskon commented 14 years ago

Perhaps I'm going about this incorrectly, but if I attempt to configure the NCommon session storage from Application_Start, HttpContext.Current.Session is null, and this causes some big problems down the line when the default session storage is initialized. I'm guessing this may have to be initialized lazily?

riteshrao commented 14 years ago

Can you post sample code that shows this behavior? How are you configuring session storage, using NCommon.Configure or manual configuration?

dplaskon commented 14 years ago

I can try to knock together a quick sample of this (the bootstrapping for my app is a little complicated/layered - so it's not really practical for me to post an excerpt here). I am using the fluent configure interface - nothing manual. I'd imagine a repo might be as simple as attempting to configure (standard) session storage from the Application_Start method in Global.asax. Since there is no HttpContext.Current.Session object available at this time, I'd expect you to see the same null ref error I was encountering.