This error may occur when building against earlier builds of NAnt as well. 

Assuming the instructions in the readme.txt file (in the NAntContrib root
folder) are followed,
[1] NAnt is built successfully
[2] NAntContrib.build is then executed with the command line specified  

The following error was encountered:

---snip---------------------------------------------------------------------
-----
buildtests:

     [copy] Copying 2 files to
'C:\nantcontrib-0.85-20040317\build\nantcontrib-0.85-debug\bin'.
      [csc] Compiling 4 files to
'C:\nantcontrib-0.85-20040317\build\nantcontrib-0.85-debug\bin\NAnt.Contrib.
Tests.dll'.
 
c:\nantcontrib-0.85-20040317\tests\Tasks\SourceSafe\GetTaskTest.cs(26,7):
error CS0246: The type or namespace name 'NUnit' could not be found (are you
missing a using directive or an assembly reference?)
 
c:\nantcontrib-0.85-20040317\tests\Util\SqlStatementListTests.cs(27,7):
error CS0246: The type or namespace name 'NUnit' could not be found (are you
missing a using directive or an assembly reference?)
 
c:\nantcontrib-0.85-20040317\tests\Util\SqlStatementListTests.cs(38,6):
error CS0246: The type or namespace name 'TestFixture' could not be found
(are you missing a using directive or an assembly reference?)
 
c:\nantcontrib-0.85-20040317\tests\Tasks\SourceSafe\GetTaskTest.cs(207,10):
error CS0246: The type or namespace name 'SetUp' could not be found (are you
missing a using directive or an assembly reference?)
 
c:\nantcontrib-0.85-20040317\tests\Tasks\SourceSafe\GetTaskTest.cs(319,10):
error CS0246: The type or namespace name 'TearDown' could not be found (are
you missing a using directive or an assembly reference?)

... lines deleted for brevity ...

 
c:\nantcontrib-0.85-20040317\tests\Tasks\SourceSafe\GetTaskTest.cs(610,10):
error CS0246: The type or namespace name 'Test' could not be found (are you
missing a using directive or an assembly reference?)
 
c:\nantcontrib-0.85-20040317\tests\Tasks\SourceSafe\GetTaskTest.cs(183,6):
error CS0246: The type or namespace name 'TestFixture' could not be found
(are you missing a using directive or an assembly reference?)

BUILD FAILED

C:\nantcontrib-0.85-20040317\NAntContrib.build(173,10):
External Program Failed:
C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\csc.exe (return code was 1)
---snip---------------------------------------------------------------------
-----

After some investigation I found that NAntContrib.build looks for
nunit.framework.dll and log4net.dll in a different location. After making
the following changes to NAntContrib.build, I was able to build
successfully.

---snip---------------------------------------------------------------------
-----
    <!-- Build the unit tests library -->
    <target name="buildtests" depends="build" description="Compiles the
NUnit Tests">
        <!-- copy NAnt assemblies needed for the tests to run -->
        <copy todir="${build.dir}/bin" flatten="true">
            <fileset basedir="${nant.dir}" failonempty="true">
                <!-- <includes
name="lib/${framework::get-family(framework::get-target-framework())}/${fram
ework::get-version(framework::get-target-framework())}/nunit.framework.dll"
/> --> *****************REMOVED THIS LINE
                <includes name="bin/nunit.framework.dll" /> ******ADDED THIS
LINE
                <includes name="bin/NAnt.Core.dll" />
                <includes name="bin/NAnt.DotNetTasks.dll" />
                <!-- <includes
name="lib/${framework::get-family(framework::get-target-framework())}/${fram
ework::get-version(framework::get-target-framework())}/log4net.dll" /> -->
*************************REMOVED THIS LINE
                <includes name="bin/log4net.dll" /> **************ADDED THIS
LINE
            </fileset>
        </copy>
        
        <!-- compile the test assembly -->
        <csc target="library" warnaserror="true" nowarn="1591"
debug="${build.debug}" define="${current.build.defines}"
output="${build.dir}/bin/${project.FormalName}.Tests.dll">
            <sources>
                <includes name="${tests.dir}/**/*.cs" />
                <!-- common assembly-level attributes -->
                <includes name="${src.dir}/CommonAssemblyInfo.cs" />
            </sources>
            <references>
                 <!-- <includes
name="${nant.dir}/lib/${framework::get-family(framework::get-target-framewor
k())}/${framework::get-version(framework::get-target-framework())}/nunit.fra
mework.dll" /> --> **************REMOVED THIS LINE
                 <includes name="${nant.dir}/bin/nunit.framework.dll" />
******ADDED THIS LINE
---snip---------------------------------------------------------------------
-----

This error is probably due to my not having the source to NUnit or Log4Net
but I expect most folk rely on the files shipped with NAnt and would be in a
similar situation.

I hope you find this feedback useful

Thanks for an excellent tool guys - please keep up the good work!

Regards
Subbu Balakrishnan



-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
NAntContrib-Developer mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/nantcontrib-developer

Reply via email to