Beispiel #1
0
        private static void GetPEInfo(string fullPath, out bool isManaged, out string publicKeyToken, out string targetFramework, out string copyright)
        {
            AssemblyName assemblyName = ContentUtil.GetAssemblyName(fullPath);

            if (assemblyName == null)
            {
                isManaged       = false;
                publicKeyToken  = string.Empty;
                targetFramework = string.Empty;
                copyright       = string.Empty;
                return;
            }

            var pktBytes = assemblyName.GetPublicKeyToken();

            isManaged      = true;
            publicKeyToken = (pktBytes == null || pktBytes.Length == 0) ? string.Empty : string.Join("", pktBytes.Select(b => b.ToString("x2")));
            GetTargetFrameworkAndCopyright(fullPath, out targetFramework, out copyright);
        }
Beispiel #2
0
 internal bool IsManaged() => ContentUtil.GetAssemblyName(FullPath) != null;