Custom Content Pipeline/serialization issues in Windows 10

Thanks @KonajuGames, it did seem to be a version of that. Unfortunately I can’t instantiate EnumReader or ReflectionReader since they are protected. But that did lead me down a path where I finally found the right values for the default.rd.xml file. Here’s the entire contents (for now):

<Directives xmlns="http://schemas.microsoft.com/netfx/2013/01/metadata">

  <Application>
    <Assembly Dynamic="Required All" Name="*Application*" />
  </Application>

  <Library Name="MonoGame.Framework">
    <Namespace Name="Microsoft.Xna.Framework.Content">
      <TypeInstantiation Name="ReflectiveReader" Arguments="TileEngine.KioskLocation" Dynamic="Required All"></TypeInstantiation>
      <TypeInstantiation Name="EnumReader" Arguments="TileEngine.KioskType" Dynamic="Required All"></TypeInstantiation>
      <TypeInstantiation Name="EnumReader" Arguments="TileEngine.DoorDirection" Dynamic="Required All"></TypeInstantiation>
      <TypeInstantiation Name="EnumReader" Arguments="TileEngine.MapEnvironment" Dynamic="Required All"></TypeInstantiation>
    </Namespace>
  </Library>
</Directives>

So that seemed to solve the immediate problem, but now I'm getting a new exception on the same Content.Load call:

An exception of type ‘System.InvalidCastException’ occurred in MonoGame.Framework.dll but was not handled in user code
Additional information: Specified cast is not valid.
If there is a handler for this exception, the program may be safely continued.

With no info on where it’s coming from. Awesome.

Also, I seem to be able to do reflection on a type that I’m not using without anything special in the default.rd.xml file. For example this code works fine:

        var testType = Type.GetType("TileEngine.TempNotUsed, TileEngine, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null");
        var testInstance = Activator.CreateInstance(testType);

Nothing really seems to make sense to me and I am questioning the concept of life itself. I wonder if my setup is borked in some weird way.