[Kde-bindings] [Qyoto] modifying assembly after building with assemblygen

David Lechner david at lechnology.com
Sat Mar 2 02:12:14 UTC 2013


At the end of main.cs in assemblygen we are using Mono.Cecil to modify 
the assembly we just created.

> AssemblyDefinition assemblyDefinition = AssemblyDefinition.ReadAssembly(cr.PathToAssembly);
> foreach (ModuleDefinition moduleDefinition in assemblyDefinition.Modules)
> {
> 	moduleDefinition.Runtime = TargetRuntime.Net_2_0;
> }
> assemblyDefinition.Write(cr.PathToAssembly);


This causes some undesirable results.

1) It invalidates the signature since we are modifying the assembly 
after it has been signed. I think the patch I made to sign the 
assemblies in mono was actually unnecessary and that this is the cause 
of the assemblies not being properly signed.

2) I makes the debug information inaccessible even if you add the /debug 
flag to the compile options. At least this is a problem with Visual 
Studio - I haven't tested it with monodevelop. So, it is not possible to 
do step debugging with the assemblies created this way.

Is there another way we can accomplish the same thing without actually 
modifying the assembly here? Or at least make it optional?



More information about the Kde-bindings mailing list