I have a data model in one application that I wish to exchange over TCPIP with another application. I need to use type handling because I want to have a single list of an abstract type containing derived types, as opposed to multiple lists for each derived type. As illustrated here:
This :
public Dictionary<int, Parameter> Parameters { get; set; }
Instead of this:
public Dictionary<int, BooleanParameter> BooleanParameters { get; set; }
public Dictionary<int, AnalogParameter> AnalogParameters { get; set; }
public Dictionary<int, SerialParameter> SerialParameters { get; set; }
public Dictionary<int, CommandTrigger> CommandTriggers { get; set; }
When I serialize using type handling, the namespace and the project name are included, and thus the second application is unable to negotiate the type.
"$type": "NAMESPACE_NAME.MyObjectType, PROJECT_NAME"
How do I tell the deserializer to ignore the namespace and project name? Same object, but different projects / namespace. I could even go so far as to make the namespaces match, but the project name was my stumbling block. It seems clunky to have to re-process the json before passing to deserializer.
One caveat is that I cannot create a class library to share between the two applications. The first application runs on proprietary hardware and the VS2008 environment is sandboxed. No external or user libraries can be referenced. The second application is open and developed in VS2015.