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

Dimitar Dobrev dpldobrev at yahoo.com
Sat Mar 2 10:25:22 UTC 2013


    

    Yet another hack that blows up in my face. :) I added this because a user and a contributor, Steven Boswell, wanted to use Qyoto with a .NET 3.5 project. On the other hand, I need the C# 4.0 compiler for default values of parameters (I know they can be simulated through overloads, and that's the way it was, but removing them is not an option). The problem is that while it's possible to use C# 4.0 with .NET 2.0/3.5, I could not find a way to make CodeDom do that. That's why I used Mono.Cecil to change the run-time - a not very good solution, as it turns out. I'd like to hear any suggestions you may have before digging further.
    

    Dimitar



________________________________
 From: David Lechner <david at lechnology.com>
To: kde-bindings at kde.org 
Sent: Saturday, March 2, 2013 4:12 AM
Subject: [Kde-bindings] [Qyoto] modifying assembly after building with assemblygen
 
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?

_______________________________________________
Kde-bindings mailing list
Kde-bindings at kde.org
https://mail.kde.org/mailman/listinfo/kde-bindings
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-bindings/attachments/20130302/fcaa3771/attachment.html>


More information about the Kde-bindings mailing list