mirror of
https://github.com/Ryujinx/Opentk.git
synced 2025-07-07 22:30:37 +00:00
Added catching of error thrown when the assembly has been rewritten but the debug symbols do not match.
This commit is contained in:
parent
c05ac4f7a0
commit
b8975c5626
|
@ -90,6 +90,8 @@ namespace OpenTK.Rewrite
|
||||||
}
|
}
|
||||||
|
|
||||||
// Load assembly and process all modules
|
// Load assembly and process all modules
|
||||||
|
try
|
||||||
|
{
|
||||||
using (AssemblyDefinition assembly = AssemblyDefinition.ReadAssembly(file, read_params))
|
using (AssemblyDefinition assembly = AssemblyDefinition.ReadAssembly(file, read_params))
|
||||||
{
|
{
|
||||||
var rewritten = assembly.CustomAttributes.FirstOrDefault(a => a.AttributeType.Name == "RewrittenAttribute");
|
var rewritten = assembly.CustomAttributes.FirstOrDefault(a => a.AttributeType.Name == "RewrittenAttribute");
|
||||||
|
@ -144,6 +146,11 @@ namespace OpenTK.Rewrite
|
||||||
assembly.Write(write_params);
|
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)
|
void Rewrite(TypeDefinition type, IEnumerable<string> options)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue