using System.Reflection.Metadata; using System.Reflection.PortableExecutable; // Open the .NET assembly using var stream = File.OpenRead("MyAssembly.dll"); using var peReader = new PEReader(stream); var metadataReader = peReader.GetMetadataReader(); // Get the GUID of a specified type var typeDefHandle = metadataReader.TypeDefinitions.Single(t => metadataReader.GetString(t.Name) == "MyType"); var typeDef = metadataReader.GetTypeDefinition(typeDefHandle); var typeGuid = metadataReader.GetGuid(typeDef.Attributes);In this example, the GetGuid method is used to retrieve the GUID of a type named "MyType" in the assembly "MyAssembly.dll". The method takes a parameter of type System.Reflection.Metadata.BlobHandle, which represents the metadata blob that contains the GUID for the specified type. The package library that contains the MetadataReader class is "System.Reflection.Metadata". This library provides APIs for reading and writing metadata in .NET assemblies, modules, and debug files.