I've been stuck on the following problem for the last few days and in desperation I am posting it here. I have successfully used NHibernate Facility in a simple console app to read and write to a database using Castle Windsor to get hold of a session manager instance and create a session.
I installed the facility libraries using NuGet and the same with Fluent NHibernate. The same versions work fine in the console application. The DLL versions are: Castle.Core.dll: 2.5.2.0 Castle.Facilities.NHibernateIntegration.dll: 1.1.0.11 Castle.Facilities.Synchronize.dll: 2.5.1.2127 Castle.Facilities.Transaction.dll: 2.5.0.52 Castle.Windsor.dll: 2.5.1.2127 FluentNHibernate.dll: 1.2.0.712 NHibernate.dll: 3.1.0.4000 When I try the exact same thing with an ASP.NET MVC 3 application injecting the session manager into a controller things fail with the following error (on the SessionManager.OpenSession() call. Method 'IsReadOnly' in type 'Castle.Facilities.NHibernateIntegration.SessionDelegate' from assembly 'Castle.Facilities.NHibernateIntegration, Version=1.1.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc' does not have an implementation. The call stack looks like this: [TypeLoadException: Method 'IsReadOnly' in type 'Castle.Facilities.NHibernateIntegration.SessionDelegate' from assembly 'Castle.Facilities.NHibernateIntegration, Version=1.1.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc' does not have an implementation.] Castle.Facilities.NHibernateIntegration.DefaultSessionManager.OpenSession(String alias) +0 Castle.Facilities.NHibernateIntegration.DefaultSessionManager.OpenSession() +37 CastleFacilitiesMvcTest.Controllers.HomeController.Index() in c: \workspace\CastleFacilitiesMvcTest\CastleFacilitiesMvcTest\Controllers \HomeController.cs:23 lambda_method(Closure , ControllerBase , Object[] ) +96 System.Web.Mvc.ActionMethodDispatcher.Execute(ControllerBase controller, Object[] parameters) +17 System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters) +208 System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +27 System.Web.Mvc.<>c__DisplayClass15.<InvokeActionMethodWithFilters>b__12() +55 System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation) +263 System.Web.Mvc.<>c__DisplayClass17.<InvokeActionMethodWithFilters>b__14() +19 System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodWithFilters(ControllerContext controllerContext, IList`1 filters, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +191 System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName) +343 System.Web.Mvc.Controller.ExecuteCore() +116 System.Web.Mvc.ControllerBase.Execute(RequestContext requestContext) +97 System.Web.Mvc.ControllerBase.System.Web.Mvc.IController.Execute(RequestContext requestContext) +10 System.Web.Mvc.<>c__DisplayClassb.<BeginProcessRequest>b__5() +37 System.Web.Mvc.Async.<>c__DisplayClass1.<MakeVoidDelegate>b__0() +21 System.Web.Mvc.Async.<>c__DisplayClass8`1.<BeginSynchronous>b__7(IAsyncResult _) +12 System.Web.Mvc.Async.WrappedAsyncResult`1.End() +62 System.Web.Mvc.<>c__DisplayClasse.<EndProcessRequest>b__d() +50 System.Web.Mvc.SecurityUtil.<GetCallInAppTrustThunk>b__0(Action f) +7 System.Web.Mvc.SecurityUtil.ProcessInApplicationTrust(Action action) +22 System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +60 System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult result) +9 System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +8841105 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +184 If anybody has any ideas I'd love to hear them because I'm all out of them. -- You received this message because you are subscribed to the Google Groups "Castle Project Users" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/castle-project-users?hl=en.
