Well this is't the only type that throw this exception when I ask for it.
Like this stack trace under this I ask for IRepository with this configuration:
x.For<ISessionFactory>().Singleton().Use(NHibernateConfigurator.Configuration().BuildSessionFactory());
x.For<ISession>().HttpContextScoped().Use(ctx => ctx.GetInstance<ISessionFactory>().GetCurrentSession());
x.For<IRepository>().Use<Repository>();
And I user Fluent-NHibernate to configure the SessionFactory.
1: Error Description:Exception of type 'System.Web.HttpUnhandledException' was thrown.
---------------------------------------
1: Source:System.Web
---------------------------------------
1: Stack Trace: at System.Web.UI.Page.HandleError(Exception e)
1: at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
1: at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
1: at System.Web.UI.Page.ProcessRequest()
1: at System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context)
1: at System.Web.UI.Page.ProcessRequest(HttpContext context)
1: at ASP.inside_community_manager_forum_aspx.ProcessRequest(HttpContext context)
1: at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
1: at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
1: Target Site:Boolean HandleError(System.Exception)
2: Error Description:Activation error occured while trying to get instance of type IRepository, key ""
---------------------------------------
2: Source:Microsoft.Practices.ServiceLocation
---------------------------------------
2: Stack Trace: at Microsoft.Practices.ServiceLocation.ServiceLocatorImplBase.GetInstance(Type serviceType, String key)
2: at Microsoft.Practices.ServiceLocation.ServiceLocatorImplBase.GetInstance[TService]()
2: at ClassLib.StaticUserFix.GetPersonalization(Int64 userId)
2: at ClassLib.Community.ForumMessage.FillObject(IDataReader dataReader)
2: at ClassLib.Community.ForumMessageDB.GetAllThreads(Int32 categoryID)
2: at inside_community_content_usercontrols_ForumThreadsList.Bind_List(Int32 currentPage)
2: at inside_community_content_usercontrols_ForumThreadsList.Page_Load(Object sender, EventArgs e)
2: at System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e)
2: at System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e)
2: at System.EventHandler.Invoke(Object sender, EventArgs e)
2: at System.Web.UI.Control.OnLoad(EventArgs e)
2: at App_Code.V3.Page.Base.BaseUserControl.OnLoad(EventArgs e)
2: at System.Web.UI.Control.LoadRecursive()
2: at System.Web.UI.Control.LoadRecursive()
2: at System.Web.UI.Control.LoadRecursive()
2: at System.Web.UI.Control.LoadRecursive()
2: at System.Web.UI.Control.LoadRecursive()
2: at System.Web.UI.Control.LoadRecursive()
2: at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
2: Target Site:System.Object GetInstance(System.Type, System.String)
3: Error Description:StructureMap Exception Code: 308
A configured instance interceptor has failed for Instance '0f986afe-0604-4e68-a3a0-1c69eb3456ce' and concrete type 'Tappa.Infrastructure.NHibernate.Repository, Tappa.Infrastructure, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'
---------------------------------------
3: Source:StructureMap
---------------------------------------
3: Stack Trace: at StructureMap.Pipeline.ObjectBuilder.ApplyInterception(Type pluginType, Object actualValue, BuildSession session, Instance instance)
3: at StructureMap.Pipeline.ObjectBuilder.Resolve(Type pluginType, Instance instance, BuildSession session)
3: at StructureMap.BuildSession.CreateInstance(Type pluginType, Instance instance)
3: at StructureMap.BuildSession.<>c__DisplayClass3.<.ctor>b__1()
3: at StructureMap.BuildSession.CreateInstance(Type pluginType)
3: at StructureMap.Container.GetInstance(Type pluginType)
3: at App_Code.BootStrapperV2.StructureMapServiceLocator.DoGetInstance(Type serviceType, String key)
3: at Microsoft.Practices.ServiceLocation.ServiceLocatorImplBase.GetInstance(Type serviceType, String key)
3: Target Site:System.Object ApplyInterception(System.Type, System.Object, StructureMap.BuildSession, StructureMap.Pipeline.Instance)
4: Error Description:The given key was not present in the dictionary.
---------------------------------------
4: Source:mscorlib
---------------------------------------
4: Stack Trace: at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
4: at StructureMap.Interceptors.InterceptorLibrary.FindInterceptor(Type type)
4: at StructureMap.Pipeline.ObjectBuilder.ApplyInterception(Type pluginType, Object actualValue, BuildSession session, Instance instance)
4: Target Site:TValue get_Item(TKey)