NHibernate Profiler doesn't see request from my ASP.NET MVC application
-
29-10-2019 - |
Question
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>
OTHER TIPS
Please make sure that the NHibernate Profiler client points to the same port as your NHibernateProfiler.Initialize()
method. The default port is 22897
.
Could be a firewall issue? Make sure the port is the same and the port can be accessed. Your latest code is running as expected?