mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 02:50:32 +00:00
comments
This commit is contained in:
parent
852ef64034
commit
08fdffd6ab
@ -155,17 +155,24 @@ static bool WeaveFromFile(string assemblyPath, string[] dependencies)
|
||||
// open the file as stream
|
||||
using (FileStream stream = new FileStream(assemblyPath, FileMode.Open, FileAccess.ReadWrite))
|
||||
{
|
||||
// resolver for this assembly
|
||||
using (DefaultAssemblyResolver asmResolver = new DefaultAssemblyResolver())
|
||||
{
|
||||
// read assembly with the following parameters
|
||||
ReaderParameters readerParameters = new ReaderParameters {
|
||||
ReadWrite = true,
|
||||
ReadSymbols = true,
|
||||
AssemblyResolver = asmResolver
|
||||
};
|
||||
|
||||
// read assembly from stream with parameters
|
||||
using (AssemblyDefinition asmDef = AssemblyDefinition.ReadAssembly(stream, readerParameters))
|
||||
{
|
||||
// add this assembly's path and unity's assembly path
|
||||
asmResolver.AddSearchDirectory(Path.GetDirectoryName(assemblyPath));
|
||||
asmResolver.AddSearchDirectory(Helpers.UnityEngineDllDirectoryName());
|
||||
|
||||
// add dependencies
|
||||
if (dependencies != null)
|
||||
{
|
||||
foreach (string path in dependencies)
|
||||
|
Loading…
Reference in New Issue
Block a user