[Ironruby-core] Bug in mscorlib, IronRuby, NewtonSoft.json..... or my code?

Ben Hall ben2004uk at googlemail.com
Wed Jun 2 18:01:48 EDT 2010


Hi,

I'm trying to use a third party library which has a dependency on
NewtonSoft.json. I create a class within IronRuby and attempt to
serialise the object to Json however it throws a null reference
exception from within mscorlib.

Any ideas?? Example is below:

Thanks

Ben

class Company
  attr_accessor :Name, :Id
end

c = Company.new
c.Name = 'test'


require 'Newtonsoft.Json'
include Newtonsoft::Json
JsonConvert.serialize_object c


mscorlib:0:in `Equals': Object reference not set to an instance of an
object. (System::NullReferenceException)
        from mscorlib:0:in `IndexOf'
        from mscorlib:0:in `IndexOf'
        from mscorlib:0:in `IndexOf'
        from Newtonsoft.Json:0:in `CheckForCircularReference'
        from Newtonsoft.Json:0:in `SerializeList'
        from Newtonsoft.Json:0:in `SerializeValue'
        from Newtonsoft.Json:0:in `SerializeISerializable'
        from Newtonsoft.Json:0:in `SerializeValue'
        from Newtonsoft.Json:0:in `SerializeISerializable'
        from Newtonsoft.Json:0:in `SerializeValue'
        from Newtonsoft.Json:0:in `WriteMemberInfoProperty'
        from Newtonsoft.Json:0:in `SerializeObject'
        from Newtonsoft.Json:0:in `SerializeValue'
        from Newtonsoft.Json:0:in `WriteMemberInfoProperty'
        from Newtonsoft.Json:0:in `SerializeObject'
        from Newtonsoft.Json:0:in `SerializeValue'
        from Newtonsoft.Json:0:in `SerializeISerializable'
        from Newtonsoft.Json:0:in `SerializeValue'
        from Newtonsoft.Json:0:in `Serialize'
        from Newtonsoft.Json:0:in `SerializeInternal'
        from Newtonsoft.Json:0:in `SerializeObject'
        from Newtonsoft.Json:0:in `SerializeObject'
        from (ir):1


More information about the Ironruby-core mailing list