I have a .Net standard 2.0 app that is referencing some contracts in a .Net45 dll. I was doing it this way under the impression that once these contract objects get serialised they will be done so using the .Net45 assembly types. Deserilising these using a .Net45 library (which is the end goal) is now giving the error:
Error resolving type specified in JSON 'System.Collections.Generic.Dictionary`2[[System.String, System.Private.CoreLib],[System.String, System.Private.CoreLib]], System.Private.CoreLib'
Which is obviously because it is trying to resolve the string type from the Standard assembly type, not from mscorlib. Is there any way of achieving what I am attempting?
There are many different ways to can tackle this.
For large code-base that cannot be easily converted to a custom ISerializationBinder I have implement a redirect (not pretty but it works)