Exemplo n.º 1
0
        unsafe void InitAssemblyName_NoLock()
        {
            var  mdai  = readerModule.MetaDataAssemblyImport;
            uint token = OriginalToken.Raw;

            Name          = MDAPI.GetAssemblySimpleName(mdai, token) ?? string.Empty;
            Version       = MDAPI.GetAssemblyVersionAndLocale(mdai, token, out var locale) ?? new Version(0, 0, 0, 0);
            Culture       = locale ?? string.Empty;
            HashAlgorithm = MDAPI.GetAssemblyHashAlgorithm(mdai, token) ?? AssemblyHashAlgorithm.SHA1;
            Attributes    = MDAPI.GetAssemblyAttributes(mdai, token) ?? AssemblyAttributes.None;
            PublicKey     = MDAPI.GetAssemblyPublicKey(mdai, token) ?? new PublicKey((byte[]?)null);
        }
Exemplo n.º 2
0
        static string CalculateFullName(CorModule manifestModule)
        {
            var  mdai  = manifestModule.GetMetaDataInterface <IMetaDataAssemblyImport>();
            uint token = new MDToken(Table.Assembly, 1).Raw;

            var asm = new AssemblyNameInfo();

            asm.Name             = MDAPI.GetAssemblySimpleName(mdai, token) ?? string.Empty;
            asm.Version          = MDAPI.GetAssemblyVersionAndLocale(mdai, token, out var locale) ?? new Version(0, 0, 0, 0);
            asm.Culture          = locale ?? string.Empty;
            asm.HashAlgId        = MDAPI.GetAssemblyHashAlgorithm(mdai, token) ?? AssemblyHashAlgorithm.SHA1;
            asm.Attributes       = MDAPI.GetAssemblyAttributes(mdai, token) ?? AssemblyAttributes.None;
            asm.PublicKeyOrToken = MDAPI.GetAssemblyPublicKey(mdai, token) ?? new PublicKey((byte[]?)null);
            return(asm.FullName);
        }