[Mono-bugs] [Bug 74959][Nor] New - [PATCH] CodeDom compilers ignore GenerateInMemory compiler parameter

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Sun May 15 10:27:53 EDT 2005


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 gert.driesen at pandora.be.

http://bugzilla.ximian.com/show_bug.cgi?id=74959

--- shadow/74959	2005-05-15 10:27:53.000000000 -0400
+++ shadow/74959.tmp.1501	2005-05-15 10:27:53.000000000 -0400
@@ -0,0 +1,61 @@
+Bug#: 74959
+Product: Mono: Class Libraries
+Version: 1.1
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: System
+AssignedTo: mono-bugs at ximian.com                            
+ReportedBy: gert.driesen at pandora.be               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: [PATCH] CodeDom compilers ignore GenerateInMemory compiler parameter
+
+Currently, both the C# and the VB.NET CodeDom compilers ignore the 
+GenerateInMemory compiler parameter.
+
+When the GenerateInMemory parameter is set, the compiled assembly should
+be loaded by a byte array (instead of using Assembly.LoadFrom) and the 
+PathToAssembly property in the CompilerResults should not be set.
+
+To reproduce this issue, compile and run the following code snippet:
+
+using System;
+using System.CodeDom;
+using System.CodeDom.Compiler;
+
+using Microsoft.VisualBasic;
+
+public class EntryPoint
+{
+  static void Main(string[] args)
+  {
+    CompilerParameters options = new CompilerParameters();
+    options.GenerateExecutable = false;
+    options.GenerateInMemory = true;
+
+    VBCodeProvider codeProvider = new VBCodeProvider();
+    ICodeCompiler compiler = codeProvider.CreateCompiler();
+    CompilerResults results = compiler.CompileAssemblyFromDom(options, 
+                new CodeCompileUnit());
+
+    if (results.CompiledAssembly.Location == string.Empty) {
+      Console.WriteLine("OK");
+    }
+  }
+}
+
+Actual result:
+
+No output (meaning, Location is not an empty string)
+
+Expected result:
+
+OK (which is what you get if you run it on MS.NET)
+
+The attached patch fixes these issues and adds unit tests.


More information about the mono-bugs mailing list