NHibernateProfiler is not compatible with .NET Core 3

41 views
Skip to first unread message

Loïc Wolff

unread,
Oct 6, 2019, 4:04:23 AM10/6/19
to nhprof
Hello.

When using 
NHibernateProfiler.Initialize();

The method fails in a netcoreapp3.0 with:

System.Reflection.TargetInvocationException: 'Exception has been thrown by the target of an invocation.'

FieldAccessException: Cannot set initonly static field 'ProxyWarnLog' after type 'NHibernate.Engine.StatefulPersistenceContext' is initialized. 

It seems probably related to a change made in .NET Core 3 where it is no longer possible to change a readonly property/field using reflection.

Logging to NHProf seems to be working anyway.
NHProfNetCoreConsoleApp.zip

Oren Eini (Ayende Rahien)

unread,
Oct 7, 2019, 10:23:30 AM10/7/19
to nhprof
Yes, the underlying issue is here: 

I have fixed the issue and a new build will be out shortly
 

--
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 view this discussion on the web visit https://groups.google.com/d/msgid/nhprof/dddbfd23-3fa1-48e4-9cb4-ac0f1ccaca49%40googlegroups.com.


--
Oren Eini
CEO   /   Hibernating Rhinos LTD
Skype:  ayenderahien
Support:  sup...@ravendb.net
Reply all
Reply to author
Forward
0 new messages