How to display FluentNHiberante Exceptions or SQL Exceptions?
I use FluentNHibernate and SQLite. Often I get Exception in the fluent configuration due to some problem with my Domain classes. But VS only pops up an InvalidOperationException, with no info about what class or method is开发者_运维知识库 the problem.
What I need to do to get displayed more useful exception info in this case?
I usually have a try catch around the creation of my session factory and I'll log and display the exception information to the log file/console. Use the exception .ToString method. This should give you more detail.
catch (Exception ex)
{
//Write to console, display, etc the exception
Console.WriteLine(ex.ToString());
}
精彩评论