pardahlman / RawRabbit

A modern .NET framework for communication over RabbitMq
MIT License
747 stars 144 forks source link

JsonSerializer System.MissingMethodException #327

Closed rafallopatka closed 6 years ago

rafallopatka commented 6 years ago

Hi,

After upgrading from RC-3 to RC-4 I noticed an error during "Request" operation, I received exception related to default serializer:

 System.MissingMethodException: Method not found: 'Void Newtonsoft.Json.JsonSerializer.set_TypeNameAssemblyFormat(System.Runtime.Serialization.Formatters.FormatterAssemblyStyle)'.
   at RawRabbit.DependencyInjection.RawRabbitDependencyRegisterExtension.

"Method not found: 'Void Newtonsoft.Json.JsonSerializer.set_TypeNameAssemblyFormat(System.Runtime.Serialization.Formatters.FormatterAssemblyStyle)'.

{RawRabbit.Serialization.ISerializer <AddRawRabbit>b__0_2(RawRabbit.DependencyInjection.IDependencyResolver)} 

It's not happening on RC-3, or when using for example MessagePack. Installing new JsonNet serializer didn't help

Best regards

pardahlman commented 6 years ago

Thanks for putting this on my radar. I believe you get this issue because TypeNameAssemblyFormat has been obsoleted in newer version of Newtonsoft.Json. To verify this, you could try to downgrade to version 10 or lower and re-run the same application.

I'll update the configuration of Newtonsoft in the upcoming rc-release

rafallopatka commented 6 years ago

Unfortunatelly I'm not able to test with older version, because in my project there is plenty of packages depending on the newest version. I tried but it cause much more errors in different areas

pardahlman commented 6 years ago

RC5 has just been released with a fix for this 🎉

rafallopatka commented 6 years ago

Wow that was quick and it solves the problem.

Thank you for your help.