[NullReferenceException: Object reference not set to an instance of an object.] HibernatingRhinos.Profiler.Appender.NHibernate3Logger.WrapNHibernateLogger.GetOriginalLoggerFactory() +60 HibernatingRhinos.Profiler.Appender.NHibernate3Logger.WrapNHibernateLogger.Initialize() +10 [TargetInvocationException: Exception has been thrown by the target of an invocation.] System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor) +0 System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments) +260 System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) +142 HibernatingRhinos.Profiler.Appender.NHibernate.NHibernateProfiler.RegisterAppenderUsingNHibernateLogger() +493 HibernatingRhinos.Profiler.Appender.NHibernate.NHibernateProfiler.StartNHibernateProfiling() +168 HibernatingRhinos.Profiler.Appender.NHibernate.NHibernateProfiler.Initialize(NHibernateAppenderConfiguration configuration) +176
--
You received this message because you are subscribed to the Google Groups "nhprof" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nhprof+un...@googlegroups.com.
To post to this group, send email to nhp...@googlegroups.com.
Visit this group at https://groups.google.com/group/nhprof.
To view this discussion on the web visit https://groups.google.com/d/msgid/nhprof/257f5439-efd0-471d-9f17-92b9116fcbc5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Oren Eini CEO / Hibernating Rhinos LTD
|
private static ILoggerFactory GetOriginalLoggerFactory(){ // Get original logger factory from: LoggerProvider.instance.loggerFactory var loggerProvider = typeof (LoggerProvider); var instanceField = loggerProvider.GetField("instance", BindingFlags.Static | BindingFlags.NonPublic | BindingFlags.GetField); var instance = (LoggerProvider)instanceField.GetValue(null); var loggerFactoryField = loggerProvider.GetField("loggerFactory", BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.GetField); var loggerFactory = (ILoggerFactory)loggerFactoryField.GetValue(instance); return loggerFactory ?? new NoLoggingLoggerFactory();}
Can you send us a sample project?
On Fri, Jun 7, 2019 at 9:08 PM Filip Filipov <filiprf...@gmail.com> wrote:
With the latest NuGet package and NHibernate versions >= 5.1.0 calling NHibernateProfiler.Initialize() fails--[NullReferenceException: Object reference not set to an instance of an object.] HibernatingRhinos.Profiler.Appender.NHibernate3Logger.WrapNHibernateLogger.GetOriginalLoggerFactory() +60 HibernatingRhinos.Profiler.Appender.NHibernate3Logger.WrapNHibernateLogger.Initialize() +10 [TargetInvocationException: Exception has been thrown by the target of an invocation.] System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor) +0 System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments) +260 System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) +142 HibernatingRhinos.Profiler.Appender.NHibernate.NHibernateProfiler.RegisterAppenderUsingNHibernateLogger() +493 HibernatingRhinos.Profiler.Appender.NHibernate.NHibernateProfiler.StartNHibernateProfiling() +168 HibernatingRhinos.Profiler.Appender.NHibernate.NHibernateProfiler.Initialize(NHibernateAppenderConfiguration configuration) +176
You received this message because you are subscribed to the Google Groups "nhprof" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nhp...@googlegroups.com.
To post to this group, send email to nhp...@googlegroups.com.
Visit this group at https://groups.google.com/group/nhprof.
To view this discussion on the web visit https://groups.google.com/d/msgid/nhprof/257f5439-efd0-471d-9f17-92b9116fcbc5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to nhprof+un...@googlegroups.com.
To post to this group, send email to nhp...@googlegroups.com.
Visit this group at https://groups.google.com/group/nhprof.
To view this discussion on the web visit https://groups.google.com/d/msgid/nhprof/8c201cce-8e86-4b50-961b-c86947655d4c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to nhprof+un...@googlegroups.com.
To post to this group, send email to nhp...@googlegroups.com.
Visit this group at https://groups.google.com/group/nhprof.
To view this discussion on the web visit https://groups.google.com/d/msgid/nhprof/8c201cce-8e86-4b50-961b-c86947655d4c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
NHibernate Version: 5.2.7
HibernatingRhinos.Profiler.Appender Version: 4.0.4038.0
HibernatingRhinos.Profiler.Appender.NHibernateLog4Net 4.0.4038.0
Initializing using the following
HibernatingRhinos.Profiler.Appender.NHibernate.NHibernateProfiler.Initialize();
Exception Thrown
Object reference not set to an instance of an object.
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at HibernatingRhinos.Profiler.Appender.NHibernate.NHibernateProfiler.RegisterAppenderUsingNHibernateLogger()
at HibernatingRhinos.Profiler.Appender.NHibernate.NHibernateProfiler.WrapLogger()
at HibernatingRhinos.Profiler.Appender.NHibernate.NHibernateProfiler.StartNHibernateProfiling()
at HibernatingRhinos.Profiler.Appender.NHibernate.NHibernateProfiler.Initialize(NHibernateAppenderConfiguration configuration)
at HibernatingRhinos.Profiler.Appender.NHibernate.NHibernateProfiler.Initialize()
at Services.App_Start.AppHost.Start() in C:\Project\App_Start\ServiceStackFramework.cs:line 434
To view this discussion on the web visit https://groups.google.com/d/msgid/nhprof/8c201cce-8e86-4b50-961b-c86947655d4c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
Oren Eini
CEO / Hibernating Rhinos LTD
Mobile: +972-52-548-6969 Sales: sa...@ravendb.net
Skype: ayenderahien Support: sup...@ravendb.net
To unsubscribe from this group and stop receiving emails from it, send an email to nhprof+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/nhprof/63ad4e2f-ed89-452d-a46e-7ca49bc504d1o%40googlegroups.com.
Oren Eini CEO / Hibernating Rhinos LTD |
|