Question

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(_);

Was it helpful?

Solution

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);
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top