Skip to content

Commit c10cd7b

Browse files
committed
use cecil to write the assembly definition in all scenarios
1 parent e42b740 commit c10cd7b

File tree

1 file changed

+1
-14
lines changed

1 file changed

+1
-14
lines changed

NetcodePatcher/CodeGen/NetcodeILPPApplicator.cs

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -133,19 +133,6 @@ public void ApplyProcesses()
133133
assembly = ApplyProcess<INetworkMessageILPP>(assembly);
134134
assembly = ApplyProcess<INetworkSerializableILPP>(assembly);
135135
assembly = ApplyProcess<ApplyPatchedAttributeILPP>(assembly);
136-
137-
if (!debugSymbolsAreEmbedded)
138-
{
139-
var outputAssemblyName = Path.GetFileNameWithoutExtension(OutputPath);
140-
var outputDirectoryName = Path.GetDirectoryName(OutputPath)!;
141-
var outputPdbPath = Path.Combine(outputDirectoryName, $"{outputAssemblyName}.pdb");
142-
143-
// save the weaved assembly to file.
144-
// some tests open it and check for certain IL code.
145-
File.WriteAllBytes(OutputPath, assembly.InMemoryAssembly.PeData);
146-
File.WriteAllBytes(outputPdbPath, assembly.InMemoryAssembly.PdbData);
147-
return;
148-
}
149136

150137
using var peStream = new MemoryStream(assembly.InMemoryAssembly.PeData);
151138
using var symbolStream = new MemoryStream(assembly.InMemoryAssembly.PdbData);
@@ -158,7 +145,7 @@ public void ApplyProcesses()
158145

159146
assemblyDefinition.Write(OutputPath, new WriterParameters
160147
{
161-
SymbolWriterProvider = new EmbeddedPortablePdbWriterProvider(),
148+
SymbolWriterProvider = debugSymbolsAreEmbedded ? new EmbeddedPortablePdbWriterProvider() : new DefaultSymbolWriterProvider(),
162149
WriteSymbols = true
163150
});
164151

0 commit comments

Comments
 (0)