.NET Native Reflection API Reference

.NET Native includes three new exception types: System.Runtime.CompilerServices.MissingInteropDataException, System.Reflection.MissingMetadataException, and System.Reflection.MissingRuntimeArtifactException. Note the following about all three exception types:

These types are for internal use only.
These three exception types are for the use of the .NET Native tool chain only. The exceptions are thrown when the .NET Native tool chain detects missing data that does not allow program execution to continue.

Do not handle these exceptions in your code.
These exceptions indicate either that metadata needed by your application is absent (the MissingInteropDataException and MissingMetadataException exceptions) or that implementation code needed by your application is missing (the MissingRuntimeArtifactException exception). You correct these exception conditions by modifying a runtime directives (.rd.xml) file to make the required metadata or implementation code available at runtime. For more information, see Runtime Directives (rd.xml) Configuration File Reference. Two troubleshooters are available that supply the appropriate entries for your runtime directives file that will eliminate MissingMetadataException and MissingRuntimeArtifactException exceptions:

Note

This reference documents three exception types that are unique to .NET Native. For reference documentation for the .NET Framework core reflection API, see the System.Reflection, System.Reflection.Context and System.Reflection.Emit namespaces. For reference documentation for the .NET Framework core interop API, see System.Runtime.InteropServices.

System.Reflection namespace

The System.Reflection namespace contains the core types used for reflection in the .NET Framework. For .NET Native, it also includes two new exception types:

Class Description
MissingMetadataException The exception that is thrown when reflection is used to retrieve metadata that isn't present.
MissingRuntimeArtifactException The exception that is thrown when metadata for a type or type member is available but its implementation has been removed.

For documentation about the other types in this namespace, see the System.Reflection reference pages in the .NET Framework documentation set.

System.Runtime.CompilerServices namespace

The System.Runtime.CompilerServices namespace includes types designed for user by language compilers. For .NET Native, it also includes a new exception type:

Class Description
MissingInteropDataException The exception that is thrown when a manual marshaling method is called, but metadata for a type isn't found by static analysis or in a runtime directives file.

For documentation about the other types in this namespace, see the System.Runtime.CompilerServices reference pages in the .NET Framework documentation set.

See also