[Mono-bugs] [Bug 397405] New: [2.0] CSharpCodeProvider captures compilation success output as an error

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Thu Jun 5 06:13:35 EDT 2008


https://bugzilla.novell.com/show_bug.cgi?id=397405


           Summary: [2.0] CSharpCodeProvider captures compilation success
                    output as an error
           Product: Mono: Class Libraries
           Version: SVN
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: System
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: atsushi at ximian.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---


The following sample illustrates the issue as stated on the summary:

--------
using System;
using System.CodeDom;
using System.CodeDom.Compiler;
using System.IO;
using Microsoft.CSharp;

public class Test
{
        public static void Main ()
        {
                string code = @"
class Test {
        int x;
}
";
                CSharpCodeProvider cp = new CSharpCodeProvider ();
                CompilerResults r = cp.CreateCompiler ()
                        .CompileAssemblyFromDomBatch (new CompilerParameters
(),
                        new CodeCompileUnit [] {new CodeSnippetCompileUnit
(code)});
                Console.WriteLine (r.Errors.Count);
                foreach (CompilerError e in r.Errors)
                        Console.WriteLine (e);
        }
}
--------

Actual result:

2
C:\DOCUME~1\atsushi\LOCALS~1\Temp\6a9097b6\a23ce97.0.cs(3,13) : warning CS0169:
The private field `Test.x' is never used
(0,0) : error : Compilation succeeded - 1 warning(s)

Expected result:

The last error line should not appear.

Additional information:

It does not happen on 1.0 profile. CSharpCodeCompiler differentiates standard
output/error handling, so that's likely the source of the issue.

It might happen only on Windows (System.Diagnostics.Process implementation
difference) -> someone please verify ;-)


-- 
Configure bugmail: https://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