19234507ba
Former-commit-id: 3494343bcc9ddb42b36b82dd9ae7b69e85e0229f
27 lines
532 B
C#
27 lines
532 B
C#
using System;
|
|
using Mono.Cecil;
|
|
using Mono.Linker;
|
|
|
|
public static class Utils
|
|
{
|
|
public static bool IsManagedAssembly (string fileName)
|
|
{
|
|
try {
|
|
ModuleDefinition module = ModuleDefinition.ReadModule (fileName);
|
|
return true;
|
|
} catch (BadImageFormatException) {
|
|
return false;
|
|
}
|
|
}
|
|
|
|
public static bool IsCrossgenedAssembly (string fileName)
|
|
{
|
|
try {
|
|
ModuleDefinition module = ModuleDefinition.ReadModule (fileName);
|
|
return module.IsCrossgened ();
|
|
} catch (BadImageFormatException) {
|
|
return false;
|
|
}
|
|
}
|
|
}
|