diff --git a/Assets/Mirror/Editor/Weaver/EntryPointILPostProcessor/CompiledAssemblyFromFile.cs b/Assets/Mirror/Editor/Weaver/EntryPointILPostProcessor/CompiledAssemblyFromFile.cs index 3630ca5a8..e4d9de2b0 100644 --- a/Assets/Mirror/Editor/Weaver/EntryPointILPostProcessor/CompiledAssemblyFromFile.cs +++ b/Assets/Mirror/Editor/Weaver/EntryPointILPostProcessor/CompiledAssemblyFromFile.cs @@ -13,30 +13,19 @@ namespace Mirror.Weaver public class CompiledAssemblyFromFile : ICompiledAssembly { readonly string assemblyPath; - InMemoryAssembly inMemoryAssembly; public string Name => Path.GetFileNameWithoutExtension(assemblyPath); public string[] References { get; set; } public string[] Defines { get; set; } + public InMemoryAssembly InMemoryAssembly { get; } public CompiledAssemblyFromFile(string assemblyPath) { this.assemblyPath = assemblyPath; - } - - public InMemoryAssembly InMemoryAssembly - { - get - { - if (inMemoryAssembly == null) - { - byte[] peData = File.ReadAllBytes(assemblyPath); - string pdbFileName = Path.GetFileNameWithoutExtension(assemblyPath) + ".pdb"; - byte[] pdbData = File.ReadAllBytes(Path.Combine(Path.GetDirectoryName(assemblyPath), pdbFileName)); - inMemoryAssembly = new InMemoryAssembly(peData, pdbData); - } - return inMemoryAssembly; - } + byte[] peData = File.ReadAllBytes(assemblyPath); + string pdbFileName = Path.GetFileNameWithoutExtension(assemblyPath) + ".pdb"; + byte[] pdbData = File.ReadAllBytes(Path.Combine(Path.GetDirectoryName(assemblyPath), pdbFileName)); + InMemoryAssembly = new InMemoryAssembly(peData, pdbData); } } }