<html><body><div style="color:#000; background-color:#fff; font-family:times new roman, new york, times, serif;font-size:12pt"><span class="tab">    <br></span><div><span class="tab">    Yet another hack that blows up in my face. :) </span>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.<br><span class="tab">    <br></span></div><div style="color: rgb(0, 0, 0); font-size: 16px;
 font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;"><span class="tab">    Dimitar</span><span class="tab"><br></span></div><div><br></div>  <div style="font-family: times new roman, new york, times, serif; font-size: 12pt;"> <div style="font-family: times new roman, new york, times, serif; font-size: 12pt;"> <div dir="ltr"> <font face="Arial" size="2"> <hr size="1">  <b><span style="font-weight:bold;">From:</span></b> David Lechner <david@lechnology.com><br> <b><span style="font-weight: bold;">To:</span></b> kde-bindings@kde.org <br> <b><span style="font-weight: bold;">Sent:</span></b> Saturday, March 2, 2013 4:12 AM<br> <b><span style="font-weight: bold;">Subject:</span></b> [Kde-bindings] [Qyoto] modifying assembly after building with assemblygen<br> </font> </div> <br>
At the end of <a target="_blank" href="http://main.cs/">main.cs</a> in assemblygen we are using Mono.Cecil to modify the assembly we just created.<br><br>> AssemblyDefinition assemblyDefinition = AssemblyDefinition.ReadAssembly(cr.PathToAssembly);<br>> foreach (ModuleDefinition moduleDefinition in assemblyDefinition.Modules)<br>> {<br>>     moduleDefinition.Runtime = TargetRuntime.Net_2_0;<br>> }<br>> assemblyDefinition.Write(cr.PathToAssembly);<br><br><br>This causes some undesirable results.<br><br>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.<br><br>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.<br><br>Is there another way we can accomplish the same thing without actually modifying the assembly here? Or at least make it optional?<br><br>_______________________________________________<br>Kde-bindings mailing list<br><a ymailto="mailto:Kde-bindings@kde.org" href="mailto:Kde-bindings@kde.org">Kde-bindings@kde.org</a><br><a href="https://mail.kde.org/mailman/listinfo/kde-bindings" target="_blank">https://mail.kde.org/mailman/listinfo/kde-bindings</a><br><br><br> </div> </div>  </div></body></html>