private static PEInfo GetPEInfo(string fullPath) { bool isManaged = ContentUtil.IsManaged(fullPath); if (!isManaged) { return(new PEInfo(isManaged)); } bool isCrossgened = ContentUtil.IsCrossgened(fullPath); string publicKeyToken = ContentUtil.GetPublicKeyToken(fullPath); GetTargetFrameworkAndCopyright(fullPath, out string targetFramework, out string copyright); return(new PEInfo(isManaged, isCrossgened, copyright, publicKeyToken, targetFramework)); }
private static void GetPEInfo(string fullPath, out bool isManaged, out string publicKeyToken, out string targetFramework, out string copyright) { isManaged = ContentUtil.IsManaged(fullPath); if (!isManaged) { publicKeyToken = string.Empty; targetFramework = string.Empty; copyright = string.Empty; return; } AssemblyName assemblyName = AssemblyName.GetAssemblyName(fullPath); var pktBytes = assemblyName.GetPublicKeyToken(); publicKeyToken = (pktBytes == null || pktBytes.Length == 0) ? string.Empty : string.Join("", pktBytes.Select(b => b.ToString("x2"))); GetTargetFrameworkAndCopyright(fullPath, out targetFramework, out copyright); }
internal bool IsManaged() => ContentUtil.IsManaged(FullPath);