4

There was a AssemblyDefinition.MainModule.SaveSymbols(); But in version 0.9.5.0, how we can save a .pdb file before saving an AssemblyDefinition.

//Here to add the command for save the .pdb file

AssemblyDefinition.Write(_);

svick
  • 236,525
  • 50
  • 385
  • 514
Jaish Mathews
  • 766
  • 1
  • 9
  • 25

1 Answers1

5

You first need a copy of the Mono.Cecil.Pdb.dll assembly and then add a reference to that assembly from your application.

Code wise you do:

var parameters = new WriterParameters ();
parameters.SymbolWriterProvider = new Mono.Cecil.Pdb.PdbWriterProvider ();
assembly.Write ("myassembly.dll", parameters);
poupou
  • 43,413
  • 6
  • 77
  • 174