阿宽

Nothing is more powerful than habit!
  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

Nhibernate 工具 Nh profiler 使用方法

Posted on 2011-01-14 14:01  宽田  阅读(814)  评论(1编辑  收藏  举报

1、:引入 dll

在你实例化ISessionFactory的项目中引用下边Dll。

 

 HibernatingRhinos.Profiler.Appender.dll //此文件在Nh Profiler安装目录中

 

2、:注册

  将下边代码放在 new Configuration()).Configure().BuildSessionFactory();前边。

   HibernatingRhinos.NHibernate.Profiler.Appender.NHibernateProfiler.Initialize();


 打开NH profiler,运行项目,就可以在NH profiler中看到SQL了。