[Mono-bugs] [Bug 536269] New: CSharpCodeProvider.CompileAssemblyFromSource fails if CompilerParameters are reused

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Wed Sep 2 09:50:50 EDT 2009


http://bugzilla.novell.com/show_bug.cgi?id=536269


           Summary: CSharpCodeProvider.CompileAssemblyFromSource fails if
                    CompilerParameters are reused
    Classification: Mono
           Product: Mono: Class Libraries
           Version: 2.4.x
          Platform: x86
        OS/Version: openSUSE 11.1
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: System
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: novell at hafner-software.de
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---


Created an attachment (id=316415)
 --> (http://bugzilla.novell.com/attachment.cgi?id=316415)
Code that reproduces the bug.

Description of Problem:
If you use the same instance of CompilerParameters for a second call of
CSharpCodeProvider.CompileAssemblyFromSource(CompilerParameters, string), the
second call fails. The CompilerResults.Errors contains one error with a message
like the following:
(0,0) : error CS0016: Could not write to file `/tmp/3b76db71/3efa7e5d.dll',
cause: Could not find a part of the path "/tmp/3b76db71/3efa7e5d.dll" 

Steps to reproduce the problem:
Run the attached Main.cs file as Console application.

Actual Results:
Creating CodeDomProvider...
Using Microsoft.CSharp.CSharpCodeProvider
Generating assembly...
Executing TestClass.TestMethod...
Hello World.
Generating assembly...
(0,0) : error CS0016: Could not write to file `/tmp/3b76db71/3efa7e5d.dll',
cause: Could not find a part of the path "/tmp/3b76db71/3efa7e5d.dll".
EXCEPTION: System.Exception: 1 error(s) found
  at TestBox.MainClass.ExecuteTestMethod
(System.CodeDom.Compiler.CodeDomProvider compiler,
System.CodeDom.Compiler.CompilerParameters compilerParameters, System.String
sourceCode) [0x00086] in /home/rupert/Projects/TestBox/TestBox/Main.cs:66 
  at TestBox.MainClass.TestMemoryAssembly () [0x0003c] in
/home/rupert/Projects/TestBox/TestBox/Main.cs:29 

Expected Results:
Creating CodeDomProvider...
Using Microsoft.CSharp.CSharpCodeProvider
Generating assembly...
Executing TestClass.TestMethod...
Hello World.
Generating assembly...
Executing TestClass.TestMethod...
Hello again, World.
SUCCESS!

How often does this happen? 
Always

Additional Information:
The "Actual Result" is a dump of the console output created with "mono
TestBox.exe >console_output.txt". The "Expected Result" is a dump of the
executable created on Windows 7 x64 ultimate. The expected result can be
produced, if you uncomment line 28 of Main.cs.

I assume that this error is a cross platform error. However, I reproduced it on
the vmware appliance image provided by mono-project.com, running mono 2.4.2.3.

-- 
Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the mono-bugs mailing list