开发者

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());
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜