This commit is contained in:
vis2k 2021-08-22 20:55:21 +08:00
parent 20be56079c
commit 0c698df4ca

View File

@ -157,7 +157,7 @@ static bool WeaveFromFile(string assemblyPath, string[] dependencies)
{
// read assembly from stream with parameters
using (DefaultAssemblyResolver asmResolver = new DefaultAssemblyResolver())
using (AssemblyDefinition asmDef = AssemblyDefinition.ReadAssembly(stream, new ReaderParameters{ ReadWrite = true, ReadSymbols = true, AssemblyResolver = asmResolver }))
using (AssemblyDefinition assembly = AssemblyDefinition.ReadAssembly(stream, new ReaderParameters{ ReadWrite = true, ReadSymbols = true, AssemblyResolver = asmResolver }))
{
// add this assembly's path and unity's assembly path
asmResolver.AddSearchDirectory(Path.GetDirectoryName(assemblyPath));
@ -174,7 +174,7 @@ static bool WeaveFromFile(string assemblyPath, string[] dependencies)
// create weaver with logger
weaver = new Weaver(new CompilationFinishedLogger());
return weaver.Weave(asmDef);
return weaver.Weave(assembly);
}
}
}