Change JSON settings in Hangfire .net4

When I’m trying to setup a recurringjob. I’m getting a JsonSerializationException: Self referencing loop detected with type.
After some Googling I found the solution to change the JsonSerializationSettings.
I did this with the following line: System.Web.Http.GlobalConfiguration.Configuration.Formatters.JsonFormatter.SerializerSettings.ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Ignore;

But I keep getting the same error. Maybe is this because of the settings not getting applied to Hangfire?

Or maybe is it because I’m using Hangfire .net4?

Found the answer that I needed to change JsonConvert.DefaultSettings.