Runtime directive for List<Nullable<T>>

191 views Asked by At

I'm getting a MissingMetadataException in the Release build of a Windows 10 Universal Application for a System.Collections.Generic.List<Nullable<System.Int32>> and can't figure out how to apply the runtime directive.

I've successfully added a directive for the simpler case, System.Collections.Generic.List<System.Int32>, which looks like this:

<TypeInstantiation Name="System.Collections.Generic.List" Arguments="System.Int32" Dynamic="Required Public" />

but I can't seem to correctly define the directive for the nested generic. I've tried quite a few variations, mostly along the lines of the following:

 <TypeInstantiation Name="System.Collections.Generic.List" Arguments="System.Nullable" Dynamic="Required Public"  >
   <TypeInstantiation Name="System.Nullable" Arguments="System.Int32" Dynamic="Required Public" />
 </TypeInstantiation>

What's the correct way to handle nested generic types here?

1

There are 1 answers

1
MattWhilden On BEST ANSWER

A few suggestions. If you enable .NET Native for DEBUG (project properties > BUILD > checkbox for Enable .NET Native) you'll get a much better overall debugging experience. In particular, you'll get more helpful messages from your exceptions as the DEBUG configuration saves the resource strings needed to make a nice error dialog. I suspect it'll point you to this page http://dotnet.github.io/native/troubleshooter/type.html which should help get you on your way.