[Mono-bugs] [Bug 80004][Maj] New - Cecil saves public key token as public key (not token)

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Tue Nov 21 18:38:33 EST 2006

Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by jones.noamle at gmail.com.


--- shadow/80004	2006-11-21 18:38:33.000000000 -0500
+++ shadow/80004.tmp.28057	2006-11-21 18:38:33.000000000 -0500
@@ -0,0 +1,57 @@
+Bug#: 80004
+Product: Mono: Class Libraries
+Version: 1.2
+OS: Windows XP
+OS Details: Windows XP Professional
+Status: NEW   
+Priority: Major
+Component: Mono.Cecil
+AssignedTo: mono at evain.net                            
+ReportedBy: jones.noamle at gmail.com               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+Summary: Cecil saves public key token as public key (not token)
+Description of Problem:
+When assembly A is saved by Cecil and it references an assembly B with 
+its public key token, Cecil actually saves the public key token as a 
+COMPLETE PUBLIC KEY and not as a token.
+Steps to reproduce the problem:
+1. Open an assembly using Mono.Cecil.AssemblyFactory.GetAssembly
+2. use assembly.MainModule.Import(type) for a type that uses a NEW strong-
+named assembly, that was previously not referenced by the opened 
+assembly. (In my case I added some IL code to a method in the opened 
+assembly, the added IL instruction was a call to a method in the 
+previously un-referenced assembly. 
+      I used 
+        System.Reflection.MethodInfo new_method typeof
+        Mono.Cecil.MethodReference imported_enter = 
+      I then accessed some method in the opened assembly and added an IL 
+instruction to call new_method.
+3. save the assembly with Mono.Cecil.AssemblyFactory.SaveAssembly
+4. Use ildasm on the created assembly to see the manifest
+Actual Results:
+in the manifest, for the referenced assembly it says ".publickey"  and 
+then the public key TOKEN appears.
+The created assembly causes an exception on .NET 2.0 ("invalid assembly 
+public key").
+Expected Results:
+in the manifest, for the referenced assembly it should 
+say ".publickeytoken" and then the public key token should appear.
+How often does this happen? 
+Additional Information:
+I'm not absolutely sure this is a bug. EMAIL me if it can't be reproduce.

More information about the mono-bugs mailing list