English 中文(简体)
使用 log4net 时无法通过 Nant 运行测试大小写
原标题:Unable to Run test case through Nant when using log4net
  • 时间:2012-05-23 05:47:55
  •  标签:
  • build
  • nant

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

当试图通过 Nunit 运行测试案例时, 生成了一个日志文件, 但是当我试图通过 Nant 运行时, 我无法运行测试案例 。

我在张贴我建筑档案中的完整信息:

<?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
et35WebDriver.dll" />
                <include name="D:selenium-
        dotnet-2.8.0
et35WebDriver.Support.dll" />
                <include name="D:selenium-
        dotnet-2.8.0
et35ThoughtWorks.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
et35WebDriver.dll" />
                    <include name="D:selenium-
        dotnet-2.8.0
et35WebDriver.Support.dll" />
                    <include name="D:selenium-
        dotnet-2.8.0
et35ThoughtWorks.Selenium.Core.dll" />
                    <include name ="D:
ant-0.91-bin
ant-0.91inlibcommon
        2.0log4net.dll" />
                    <!-- <include name="${nant::scan-probing-paths( log4net.dll )}" />-->
                </references>
            </test>
        </nunit2>
    </target>
</project> 

根据我的建筑文件 是否有明显错误 阻止我处理测试案例?

问题回答

控制台输出是什么? NAnt 包含其核心的对数 4net, 我见过当一个代码使用不同于 Nant 的不同版本的对数 4net 时, 它会产生问题。 您可以尝试使用 < code\ lt; exec> 任务来运行单元测试 -- -- 特别是因为 NAnt s 任务使用了令人发指的过期的 NUM 2. 2 。





相关问题
Create directory using Nant

Not sure if I m just totally missing it but I couldn t not figure out how to create a new directory using Nant. Is there built in functionality to do this? Can I just use the command prompt? I tried ...

Setting write permissions on godaddy hosting

I have godaddy asp.net hosting. Every time I upload the build, it’s a manual laborious task of setting write permissions (to folders) through the web interface. Is this any way to automate this ...

What are solid NMaven or build servers for .NET alternatives?

Maven had a long history and is well supported in the Java world. NMaven has received a less successful start and has never become as popular in the C#/.NET world as its larger cousin was in the Java ...

Gallio and MbUnit in NAnt

I am trying to use Gallio (v3.1)/MbUnit/NCover to run a unit test in my C# code, as part of the build process for my continuous integration system. I can get Gallio.Echo.exe to execute the tests and ...

TeamCity NUnit test result visualisation

Is there any way to produce visual results of NUnit tests from within TeamCity s "Tests" tab, currently my NAnt script outputs an .xml file of the results using the following task: <nunit2 ...

building .net applications without Visual Studio

I m interested to hear about people working with building .net applications using MSBuild, NAnt or similar tools. What are you using, why are you using it instead of the VS IDE? I like to use ...

热门标签