Merge pull request #527 from Nihlus/rewriter-cecil-0.10
Additional error check in rewriter
This commit is contained in:
commit
c697eaed75
1 changed files with 43 additions and 36 deletions
|
@ -90,6 +90,8 @@ namespace OpenTK.Rewrite
|
|||
}
|
||||
|
||||
// Load assembly and process all modules
|
||||
try
|
||||
{
|
||||
using (AssemblyDefinition assembly = AssemblyDefinition.ReadAssembly(file, read_params))
|
||||
{
|
||||
var rewritten = assembly.CustomAttributes.FirstOrDefault(a => a.AttributeType.Name == "RewrittenAttribute");
|
||||
|
@ -144,6 +146,11 @@ namespace OpenTK.Rewrite
|
|||
assembly.Write(write_params);
|
||||
}
|
||||
}
|
||||
catch (InvalidOperationException inex)
|
||||
{
|
||||
Console.WriteLine("Failed to load the assembly. It may already have been rewritten, and the debug symbols no longer match.");
|
||||
}
|
||||
}
|
||||
|
||||
void Rewrite(TypeDefinition type, IEnumerable<string> options)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue