Table of Contents

Enum MetadataBuilderFlags

Namespace
AsmResolver.DotNet.Builder
Assembly
AsmResolver.DotNet.dll

Provides members for describing the behaviour of the .NET directory builder.

[Flags]
public enum MetadataBuilderFlags

Fields

ForceEncMetadata = 524288

Setting this flag will force the builder to emit edit-and-continue metadata, even if it is not required.

NoResourceDataDeduplication = 262144

By default, when adding two embedded resources to a file with identical contents, AsmResolver will not add the second copy of the data to the output file and instead reuse the first blob. This can drastically reduce the size of the final output file.

While supported by the .NET runtime, some post-processors (e.g., obfuscators) may not work well with this or depend on individual resource items to be present. Setting this flag will disable this optimization.

NoStringsStreamOptimization = 131072

By default, AsmResolver will optimize the #Strings stream for size. This means that strings that are a suffix of another will not be added twice to the buffer, but rather will be referenced using an offset within the longer string. This avoids lots of duplication in the final stream.

Setting this flag will disable this optimization.

None = 0

Indicates no special metadata builder flags.

PreserveAll = PreserveBlobIndices | PreserveGuidIndices | PreserveStringIndices | PreserveUserStringIndices | PreserveTableIndices | NoStringsStreamOptimization | NoResourceDataDeduplication

Indicates any kind of index into a blob or tables stream, as well as unknown spurious metadata streams should be preserved whenever possible during the construction of the metadata directory.

PreserveAssemblyReferenceIndices = 32768

Indicates indices into the assembly reference table should be preserved whenever possible during the construction of the metadata directory.

PreserveBlobIndices = 1

Indicates indices into the #Blob stream should be preserved whenever possible during the construction of the metadata directory.

PreserveEventDefinitionIndices = 2048

Indicates indices into the event definition table should be preserved whenever possible during the construction of the metadata directory.

PreserveFieldDefinitionIndices = 64

Indicates indices into the field definition table should be preserved whenever possible during the construction of the metadata directory.

PreserveGuidIndices = 2

Indicates indices into the #GUID stream should be preserved whenever possible during the construction of the metadata directory.

PreserveMemberReferenceIndices = 512

Indicates indices into the member reference table should be preserved whenever possible during the construction of the metadata directory.

PreserveMethodDefinitionIndices = 128

Indicates indices into the method definition table should be preserved whenever possible during the construction of the metadata directory.

PreserveMethodSpecificationIndices = 65536

Indicates indices into the method specification table should be preserved whenever possible during the construction of the metadata directory.

PreserveModuleReferenceIndices = 8192

Indicates indices into the module reference table should be preserved whenever possible during the construction of the metadata directory.

PreserveParameterDefinitionIndices = 256

Indicates indices into the parameter definition table should be preserved whenever possible during the construction of the metadata directory.

PreservePropertyDefinitionIndices = 4096

Indicates indices into the property definition table should be preserved whenever possible during the construction of the metadata directory.

PreserveStandAloneSignatureIndices = 1024

Indicates indices into the stand-alone signature table should be preserved whenever possible during the construction of the metadata directory.

PreserveStreamOrder = 262144

Indicates unconventional metadata stream order in the .NET metadata directory should be preserved when possible.

PreserveStringIndices = 4

Indicates indices into the #Strings stream should be preserved whenever possible during the construction of the metadata directory.

PreserveTableIndices = PreserveTypeReferenceIndices | PreserveTypeDefinitionIndices | PreserveFieldDefinitionIndices | PreserveMethodDefinitionIndices | PreserveParameterDefinitionIndices | PreserveMemberReferenceIndices | PreserveStandAloneSignatureIndices | PreserveEventDefinitionIndices | PreservePropertyDefinitionIndices | PreserveModuleReferenceIndices | PreserveTypeSpecificationIndices | PreserveAssemblyReferenceIndices | PreserveMethodSpecificationIndices

Indicates indices into the tables stream should be preserved whenever possible during the construction of the metadata directory.

PreserveTypeDefinitionIndices = 32

Indicates indices into the type definition table should be preserved whenever possible during the construction of the metadata directory.

PreserveTypeReferenceIndices = 16

Indicates indices into the type references table should be preserved whenever possible during the construction of the metadata directory.

PreserveTypeSpecificationIndices = 16384

Indicates indices into the type specification table should be preserved whenever possible during the construction of the metadata directory.

PreserveUnknownStreams = 131072

Indicates unconventional / spurious metadata streams present in the .NET metadata directory should be preserved when possible.

PreserveUserStringIndices = 8

Indicates indices into the #US stream should be preserved whenever possible during the construction of the metadata directory.