Search code examples
c#.net-coremetadatalow-levelsystem.reflection.metadata

How can i see if a TypeDefinition is a Struct?


I want to know if a TypeDefinition is a Struct, there is no way I can see since the TypeAttributes will just give me an ambiguity between struct and class.

this is for a Scanning program that is going to try and recreate the assembly at a high-level manner that is easy to programmatically optimize, trim and merge without actually needing to load the assembly file.

I'm doing this in Dotnet Core targated for >=2.0 applications.


Solution

  • after Suggestions from @Flydog57 and @Marc Gravell i looked at the BaseType,

    which came out as System.ValueType. Thanks for the suggestion.