When running a unittest, I receive the following Exception:
Test method threw exception: System.MissingMethodException: Method not found: 'System.String DataUtilities.HelperMethods.Serialize(!!0)'..
This only happens when running the unittest and not when debugging it. When I debug it, no error occurs.
The signature of the method that is called:
public static string Serialize<T>(T value)
The method is in a referenced dll.
I noticed the following: In the referenced dll there is a method that wraps the call to the Serialize(T value) method.
Its code is:
public static string SerializeList(List<object> list)
{
TraceClass.Write("something",list);
string x = HelperClass.Serialize<List<object>>(list);
TraceClass.Write(x);
return x;
}
If I call the HelperClass.Serialize using this "indirection" it works fine. In debug and normal run mode.
What am I doing wrong?