0

I'm getting BuildSessionFactory null exception.

Using Nhibernate 3.3.3.4000 , .NET 4.5 , MVC 4 and;

ISessionFactory sessionFactory = new Configuration().Configure().BuildSessionFactory();

When i try this code block im getting null exception. Tried install nuget package several times and checked web.config. Nothing changed.

Anyone can help me?

edit-1 StackTrace of Exception

at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
   at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ThreadHelper.ThreadStart()  

 at NHibernate.Engine.NamedSQLQueryDefinition..ctor(String query, INativeSQLQueryReturn[] queryReturns, IList`1 querySpaces, Boolean cacheable, String cacheRegion, Int32 timeout, Int32 fetchSize, FlushMode flushMode, Nullable`1 cacheMode, Boolean readOnly, String comment, IDictionary`2 parameterTypes, Boolean callable)
   at NHibernate.Cfg.XmlHbmBinding.NamedSQLQueryBinder.<>c__DisplayClass1.<AddSqlQuery>b__0(IDictionary`2 param0)
   at NHibernate.Cfg.Configuration.SecondPassCompile()
   at NHibernate.Cfg.Configuration.BuildSessionFactory()

Thanks already.

2
  • Post the stack trace of the exception Commented Apr 15, 2013 at 14:44
  • Can you post the answer as an answer and mark it correct please? Commented Apr 15, 2013 at 15:35

1 Answer 1

2

I found the solution! In my model mapping I left blank one of my SQL-queries. :)

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.