2

I am working on an issue with UWP application with Xamarin.Forms. I have noticed that when I set the build configuration to Release mode MessagingCenter class stop working without crashing but in Debug mode MessagingCenter works fine.

I set my output log to verbose mode and it is clean without any error or exception. I guess that ".Net Native tool chain" is optimizing the code and aggressively removing some of the dependencies. Has anyone faced this issue before or maybe know a workaround for this?

ssmsexe
  • 209
  • 2
  • 4
  • 10
  • I could not reproduce your issue in my side. Could you provide a simple sample that can reproduce this issue? – Nico Zhu Aug 14 '17 at 03:05
  • I can reproduce it in my project. What may cause this issue in your opinion? – ssmsexe Aug 14 '17 at 22:23
  • I managed to reproduce it too. It happens on the MessagingCenter.Send method throwing a `System.NullReferenceException: Arg_NullReferenceException at Xamarin.Forms.MessagingCenter.Subscription.InvokeCallback(Object sender, Object args) at Xamarin.Forms.MessagingCenter.InnerSend(String message, Type senderType, Type argType, Object sender, Object args)`. Unfortunately, I don't know how to work around this. – blas3nik Oct 10 '17 at 04:39
  • In my case there were no exception at all! Is this happening only in release mode? – ssmsexe Oct 10 '17 at 04:48
  • It only happens if the .net Native tool chain is used for compilation - which is set so in Release mode by default. – blas3nik Oct 10 '17 at 15:32
  • Can you share the repro code in github? – ssmsexe Oct 10 '17 at 20:37

0 Answers0