Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8819215
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T05:17:58+00:00 2026-06-14T05:17:58+00:00

I have a very simple class with Watin test which is built and run

  • 0

I have a very simple class with Watin test which is built and run nicely from Visual Studio.
Now I want to build it and launch with Nant. I’ve written the following nant .build file:

<?xml version="1.0"?>
<project name="WatinTests" default="build">
  <property name="build.dir" value="c:WatinTests\bin\" />
  <property name="project.rootdirectory" value="." />
  <property name="solution.dir" value="."/>
  <property name="solution.file" value="${solution.dir}/WatinTests.csproj"/>
  <property name="build.configuration" value="debug" />
  <property name="nant.settings.currentframework" value="net-4.0" />
  <mkdir dir="${build.dir}" />
  <target name="build">
    <exec
      program="${framework::get-framework-directory(framework::get-target-framework())}\msbuild.exe"
      commandline="${solution.file} /t:Clean /p:Configuration=${build.configuration} /v:q"
      workingdir="."
      output="${build.dir}/WatinTests.dll" />
  </target>
  <target name="test" depends="build">
    <nunit2>
      <formatter type="Plain" />
      <test assemblyname="${build.dir}WatinTests.dll" />
    </nunit2>
  </target>
</project>

First task is performed successfully – WatinTests.dll file goes to \bin directory.
But test is not launched. Here is the output:

Buildfile: file:///c:/WatinTests/nant.build Target framework:
Microsoft .NET Framework 4.0 Target(s) specified: build test

build:

test:

BUILD FAILED

c:\WatinTests\nant.build(14,6): Failure executing test(s). If you
assembly is not built using NUnit version 2.6.0.12051, then ensure you
have redirected ass embly bindings. Consult the documentation of the
task for more information.
Could not load file or assembly ‘WatinTests.dll’ or one of its dependencies. An attempt was made to load a program with an incorrect
format.
Could not load file or assembly ‘WatinTests.dll’ or one of its dependencies. An attempt was made to load a program with an incorrect
format.

What is wrong here?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T05:17:59+00:00Added an answer on June 14, 2026 at 5:17 am

    As mentioned in the Nant documentation, did you add the assembly binding redirection into your app.config :

    <runtime>
      <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
        <dependentAssembly>
          <assemblyIdentity name="nunit.framework" publicKeyToken="96d09a1eb7f44a77" culture="Neutral" />
          <bindingRedirect oldVersion="0.0.0.0-2.2.8.0" newVersion="2.2.8.0" />
        </dependentAssembly>
      </assemblyBinding>
    </runtime> 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a very simple class which I want to use as a subclass
I have a very simple class that has a single property and which inherits
I have a very simple file watcher class which checks every 2 seconds if
I have a very simple class called Profile. It contains NSMutableArray called avatar which
Hi I have a very simple integration test require 'integration_test_helper' Capybara.current_driver = :rack_test class
I have a very simple viewmodel class, and a strongly typed view (which uses
I have a very simple xml string that I loaded using XmlDocument class. Now
I have a very simple class (currently used as a testing class), which uses
I use Resharper tool in visual studio Consider a very simple class written below.
I have a very simple class (shown below), however every time I run it,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.