-1

I am working on a dotnet 2008, Nunit 2.6,Nant0.91 application. I am using log4net for my logging purposes.

When trying to run test cases through Nunit, a log file is generated, but when I try to run it through Nant, I am unable to run my test case.

I am pasting the complete information present in my build file:

<?xml version="1.0" encoding="utf-8"?>
<project name="w2" default="run" basedir=".">
    <!--Here we are building DLL -->
    <target name="build">
        <mkdir dir="Libraries" />
        <mkdir dir="Output"/>
        <csc target="library" output="Libraries/${project::get-
        name()}.dll">
            <sources>
                <include name="C:\\Users\\rm99699\\Documents\\Visual Studio
        2008\\Projects\\w2\\w2\\*.cs" />
                <include name="C:\\Users\\rm99699\\Documents\\Visual Studio 2008\
        \Projects\\w2\\w2\\app.config.xml"/>
            </sources>
            <references basedir="Libraries">
                <include name="${nant::scan-probing-
        paths('nunit.framework.dll')}" />
                <include name="${nant::scan-probing-paths('log4net.dll')}" />
                <include name="D:\selenium-
        dotnet-2.8.0\net35\WebDriver.dll" />
                <include name="D:\selenium-
        dotnet-2.8.0\net35\WebDriver.Support.dll" />
                <include name="D:\selenium-
        dotnet-2.8.0\net35\ThoughtWorks.Selenium.Core.dll" />
            </references>
        </csc>
    </target>

    <!--Here we are running testcases -->

    <target name="run" depends="build">
        <nunit2 failonerror="false" >
            <formatter type="Xml" usefile="true" extension=".xml"
                       outputdir="Output"/>
            <test assemblyname="C:\\Users\\rm99699\\Documents\\Visual Studio 2008\
        \Projects\\w2\\w2\\Libraries\\w2.dll"  appconfig="C:\\Users\\rm99699\
        \Documents\\Visual Studio 2008\\Projects\\w2\\w2\\app.config">
                <references basedir="Libraries">
                    <include name="${nant::scan-probing-
        paths('nunit.framework.dll')}" />
                    <include name="D:\selenium-dotnet-2.8.0\net35\WebDriver.dll" />
                    <include name="D:\selenium-
        dotnet-2.8.0\net35\WebDriver.Support.dll" />
                    <include name="D:\selenium-
        dotnet-2.8.0\net35\ThoughtWorks.Selenium.Core.dll" />
                    <include name ="D:\nant-0.91-bin\nant-0.91\bin\lib\common
        \2.0\log4net.dll" />
                    <!-- <include name="${nant::scan-probing-paths('log4net.dll')}" />-->
                </references>
            </test>
        </nunit2>
    </target>
</project> 

Based on my build file, are there any visible errors that are preventing me from running my test case?

thejartender
  • 9,339
  • 6
  • 34
  • 51

1 Answers1

0

What is the console output? NAnt includes log4net in it's core, and I've seen cases where it causes problems when one's code uses a different version of log4net than NAnt does. You could try using an <exec> task to run the unit tests -- especially since NAnt's <nunit2> task uses a heinously outdated NUnit 2.2.

robrich
  • 13,017
  • 7
  • 36
  • 63
  • Iam getting the below error in command prompt. log4net: Hierarchy: Shutdown called on Hierarchy [log4net-default-repository] – user1411739 May 23 '12 at 06:56