Menu

#729 <csc> Task output dir is not created automatically

closed-fixed
Tasks (408)
5
2014-08-15
2010-04-10
No

Copied from bug 2981389
In addition you also might check "CompilerBase.cs".
Currently output dir must be created in advance. If not, a simple <csc>
task will fail

Discussion

  • Charles Chan

    Charles Chan - 2010-04-10

    Need to investigate the nature of this issue and whether it is also inconsistent with the other tasks.

     
  • Charles Chan

    Charles Chan - 2010-04-11
    • assigned_to: nobody --> cchan_qa
     
  • Charles Chan

    Charles Chan - 2010-04-11
     
  • Charles Chan

    Charles Chan - 2010-04-11

    With the attached test-project.zip, I was able to recreate the problem. Basically when the specified output path includes non-existing directories, the task will fail. Instead to make the task more user firendly, the first step should automatically the directories automatically, then to allow the output binaries to be created.

    test.build
    -----------
    <?xml version="1.0"?>
    <project name="Hello World">
    <csc target="exe" output="bin\HelloWorld.exe" debug="true">
    <nowarn>
    <!-- do not report warnings for missing XML comments -->
    <warning number="0519" />
    </nowarn>
    <sources>
    <include name="*.cs" />
    </sources>
    <references>
    <include name="System.dll" />
    <include name="System.Data.dll" />
    </references>
    </csc>
    </project>

    Output
    -------

    NAnt 0.90 (Build 0.90.3742.0; alpha1; 3/31/2010)
    Copyright (C) 2001-2010 Gerry Shaw
    http://nant.sourceforge.net

    Buildfile: file:///C:/cygwin/home/admin/nant/scratch/test.build
    Target framework: Microsoft .NET Framework 2.0

    [csc] Compiling 1 files to 'C:\cygwin\home\admin\nant\scratch\bin\HelloWorld.exe'.
    [csc] warning CS1691: '0519' is not a valid warning number
    [csc] fatal error CS0042: Unexpected error creating debug information file 'c:\cygwin\home\admin\nant\scratch\bin\ c:\cygwin\home\admin\nant\scratch\bin\HelloWorld.pdb: The system cannot find the path specified.
    [csc] '

    BUILD FAILED

    C:\cygwin\home\admin\nant\scratch\test.build(3,6):
    External Program Failed: c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\csc.exe (return code was 1)

    Total time: 0.6 seconds.

     
  • Charles Chan

    Charles Chan - 2010-04-12
    • status: open --> closed-fixed
     
  • Charles Chan

    Charles Chan - 2010-04-12

    Fixed.

    src/NAnt.DotNet/Tasks/CompilerBase.cs
    tests/NAnt.DotNet/Tasks/CscTaskTest.cs
    tests/NAnt.DotNet/Tasks/JscTaskTest.cs
    tests/NAnt.DotNet/Tasks/VbcTaskTest.cs
    tests/NAnt.DotNet/Tasks/VjcTaskTest.cs

    Checked into CVS.

     

Log in to post a comment.