Ejemplo n.º 1
0
        private DotNetFramework GetFramework()
        {
            var mscorlib = GetReferencedMscorlib();

            if (mscorlib != null)
            {
                return(DotNetFramework.GetByMscorlib(mscorlib));
            }
            else
            {
                return(DotNetFramework.Get(FrameworkType.MicrosoftNet, _module.FrameworkVersionMoniker));
            }
        }
Ejemplo n.º 2
0
        private void Load()
        {
            var image = _module.Image;

            if (image.GetAssemblyCount() == 0)
            {
                throw new AssemblyLoadException(string.Format(SR.AssemblyLoadError, _module.Location));
            }

            AssemblyRow row;

            image.GetAssembly(1, out row);

            _name    = image.GetString(row.Name);
            _culture = image.GetString(row.Locale);
            _processorArchitecture = (ProcessorArchitecture)((int)(row.Flags & AssemblyFlags.PA_Mask) >> (int)AssemblyFlags.PA_Shift);
            _version       = new Version(row.MajorVersion, row.MinorVersion, row.BuildNumber, row.RevisionNumber);
            _publicKey     = image.GetBlob(row.PublicKey);
            _hashAlgorithm = row.HashAlgId;
            _framework     = GetFramework();
        }