I have an ASP.Net Core application that deploys perfectly to Azure AppServices and runs like a dream. Hangfire integration worked seamlessly on a local machine, but when the project was deployed to Azure AppServices all the goodness came crashing down.
The website would not start and tossed the vanilla 500.30 error. Upon inspecting the logs the following error message was found to be the culprit:
Unhandled exception. System.IO.FileNotFoundException: Could not load file or assembly 'Newtonsoft.Json, Version=188.8.131.52, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed'. The system cannot find the file specified. File name: 'Newtonsoft.Json, Version=184.108.40.206, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' at Hangfire.GlobalConfigurationExtensions.UseRecommendedSerializerSettings at Hangfire.GlobalConfigurationExtensions.UseRecommendedSerializerSettings(IGlobalConfiguration configuration)
It appears that Hangfire is hung up on Newtonsoft.Json v11 and doesn’t want to use the installed Newtonsoft.Json v13 that is required by other nuget. Is it possible to configure Hangfire to not be tightly bound to v11?