Search code examples
asp.net.netnhprofnhibernate-profiler

NHibernate Profiler doesn't see request from my ASP.NET MVC application


I'm using NHProf with ASP.NET MVC 3.

I inserted

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

in my Application_Start method, but NHProf still doesn't see my sessions and doesn't show up anything.

What could be the source of my problem?


Solution

  • Do you setup a log4net configuration?

    You can look here:

    How do I configure NHibernate Profiler so I can enable/disable it without changing code?

    And sample from my web.config:

    <appender name="NHProfAppender"
          type="HibernatingRhinos.Profiler.Appender.NHibernate.NHProfAppender, 
          HibernatingRhinos.Profiler.Appender.NHibernateLog4Net">
        <sink value="tcp://127.0.0.1:22897" />
      </appender>
      <logger name="HibernatingRhinos.Profiler.Appender.NHibernate.NHProfAppender.Setup">
        <appender-ref ref="NHProfAppender"/>
      </logger>