SerializationCodeIsMissingForType troubleshooter

The .NET Native framework has 3 built-in serializers, namely XmlSerializer, DataContractSerializer, and DataContractJsonSerializer. These serializers are non-reflection based serializers, relying on the .NET Native compiler to do the analysis of the application and generate the required serialization code for each type which it can detect is serialized and deserialized at runtime.

In some scenarios the .NET Native compiler cannot detect that a particular type is used in serialization. Your app will encounter an InvalidDataContractException with SerializationCodeIsMissingForType exception at runtime if it attempts to serialize or deserialize a type with missing serialization code. In those cases, you need to describe the root serialization type by means of a Runtime Directive.

I serialize/deserialize

A single type

There's no pattern. A single type with the following name:

All types in a namespace

All types within the following namespace:

All types in an assembly

All types in the following assembly:

I use

DataContractSerializer

DataContractJsonSerializer

XmlSerializer

Preview

This preview shows you the runtime directive corresponding to the choices you made in the left column. If you're adding a directive to an existing RD.XML file, append the directives under the <Application> element to the <Application> element of the existing RD.XML.

If you are authoring an RD.XML for a library, replace <Application> with <Library> .