NANT 0.92 SDK 7 not found - nant

Environment:
Windows 2008 R2 64Bit SDK installed at C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1
Framework installed at C:\Windows\Microsoft.NET\Framework64\v4.0.30319
Trying to run Nant to compile some .NET 4 classes and we are getting
the following message.
The SDK for the 'net-4.0' framework is not available or not configured.:
NAnt.Core.BuildException: The SDK for the 'net-4.0'
framework is not available or not configured.
at NAnt.Core.Tasks.ExternalProgramBase.DetermineFilePath()
at NAnt.Core.Tasks.ExternalProgramBase.get_ProgramFileName()
at
NAnt.Core.Tasks.ExternalProgramBase.PrepareProcess(Process process)
at NAnt.Core.Tasks.ExternalProgramBase.StartProcess()
at NAnt.Core.Tasks.ExternalProgramBase.ExecuteTask()
at NAnt.Core.Task.Execute()
at NAnt.Core.Target.Execute()
at NAnt.Core.Project.Execute(String targetName, Boolean
forceDependencies)
at NAnt.Core.Project.Execute()
at NAnt.Core.Project.Run()
In looking at the NANt.exe.config it would appear that it looks to the
registry to find the applicable path for the SDK.
<project>
<readregistry
property="installRoot"
key="SOFTWARE\Microsoft\.NETFramework\InstallRoot"
hive="LocalMachine" />
<locatesdk property="sdkInstallRoot"
minwinsdkver="v7.0A" minnetfxver="4.0" maxnetfxver="4.0.99999"
failonerror="false" />
</project>
The key does not exist in the registry nor does our SDK version match the minwinsdkver="v7.0A"
Anyone run into this issue and found a valid work-around?

Simplest solution is to add the key to the registry.
For myself the registry entry was slightly different: at HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft.NETFramework set sdkInstallRootv2.0=C:\Program Files\Microsoft SDKs\Windows\v7.0A.
After this Nant compiled fine as expected.

I ran into this issue yesterday. Another workaround is to mark the NAnt executable as 32 bit.
Open a Developer Command Prompt
Change to the directory that contains your NAnt executable.
Run the following command: corflags NAnt.exe /32Bit+

Related

The specified task executable "postsharp.4.0-x86.exe" could not be run. The filename or extension is too long

PostSharp build step fails with
The specified task executable "postsharp.4.0-x86.exe" could not be
run. The filename or extension is too long
when run on build machine or locally with PostSharpHost=Native.
The cause looks to be the large number of references passed to postsharp.4.0-x86.exe via /P:ResolvedReferences parameter.
It works fine locally when using default PostSharpHost=PipeServer. However, PipeServer value is being ignored on build machine when build is run in non-interactive mode.
What are the options to resolve this issue? Is is possible to force using PipeServer on the build machine in non-interactive mode?
Here is a fragment from build log causing the issue:
C:\ProgramData\PostSharp\3.1.73\bin.Release\postsharp.4.0-x86.exe obj\Release\Before-PostSharp\Xxx.xxxxxxxxxxxxxxx.dll /X:default /NoLogo /L:44054-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx /P:Output=C:\Dev\Xxxxx\xxx-xxxxx-xx\Xxx.xxxxxxxxxxxxxxs\obj\Release\Xxx.xxxxxxxxxxxxxxx.dll /P:ReferenceDirectory=C:\Dev\Xxxxx\xxx-xxxxx-xx\Xxx.Xxxxx.XxxxXxxxx /P:Configuration=Release /P:Platform=AnyCPU "/P:SearchPath=..\bin\|obj\Release\|C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\|C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\Facades\ " /P:IntermediateDirectory=obj\Release\PostSharp /P:CleanIntermediate=False /P:MSBuildProjectFullPath=C:\Dev\Xxxxx\xxx-xxxxx-xx\Xxx.xxxxxxxxxxxxxxs\Xxx.Xxxxx.XxxxXxxxx.csproj /P:SignAssembly=False /P:PrivateKeyLocation= /P:PrivateKeyContainer= /P:DelaySign= "/P:ResolvedReferences=C:\Dev\Xxxxx\xxx-xxxxx-xx\packages\Xxx.xxxxxxxm\lib\AWSSDK.dll|C:\Dev\xxxxx\xxx-xxxxx-xx\packages\BitSyntax\lib\net45\BitSyntax.dll|C:\Dev\xxxxx\xxx-xxxxx-xx\packages\BitSyntax\lib\net45\BitSyntaxCs.dll|C:\Dev\xxxxx\xxx-xxxxx-xx\packages\Xxx.xxxxxxxm\lib\Castle.Core.dll|C:\Dev\xxxxx\xxx-xxxxx-xx\packages\Xxx.xxxxxxxm\lib\Castle.Windsor.dll|C:\Dev\xxxxx\xxx-xxxxx-xx\packages\XxxxxxCxxxxxxxxxxxxs\lib\net40\Xxxxxx.xxxxxxxs.dll|C:\Dev\xxxxx\xxx-xxxxx-xx\packages\XxxxxxCxxxxxxxxxxxxs\lib\net40\Xxxxxx.xxxxxxxxs.dll|C:\Dev\xxxxx\xxx-xxxxx-xx\packages\XxxxxxCxxxxxxxxxxxxs\lib\net40\Xxxxxx.dll|C:\Dev\xxxxx\xxx-xxxxx-xx\packages\XxxxxxCxxxxxxxxxxxxs\lib\net40\Xxxxxx.xxxxxxxxxs.dll|C:\Dev\xxxxx\xxx-xxxxx-xx\packages\Xxx.xxxxxxxm\lib\FileHelpers.dll|C:\Dev\xxxxx\xxx-xxxxx-xx\packages\FSharp.Core\lib\net40\FSharp.Core.dll|C:\Dev\xxxxx\xxx-xxxxx-xx\packages\FSharp.Data\lib\net40\FSharp.Data.dll|C:\Dev\xxxxx\xxx-xxxxx-xx\packages\FsPickler.CSharp\lib\net45\FsPickler.CSharp.dll|C:\Dev\xxxxx\xxx-xxxxx-xx\packages\FsPickler\lib\net45\FsPickler.dll|C:\Dev\xxxxx\xxx-xxxxx-xx\packages\FsPickler.Json\lib\net45\FsPickler.Json.dll|C:\Dev\xxxxx\xxx-xxxxx-xx\packages\FsUnit\Lib\Net40\FsUnit.NUnit.dll|C:\Dev\xxxxx\xxx-xxxxx-xx\packages\Xxxxxxxx.xxxxxxxxxxxxxxxxxxxxxg\lib\net40\Xxxxxxxx.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.dll|C:\Dev\xxxxx\xxx-xxxxx-xx\packages\Xxxxxxxx.xxxxxxxxxxxxxxxxxxxxxg\lib\net40\Xxxxxxxx.xxxxxxxxxxxxxxxxxxxxxx.dll|C:\Dev\xxxxx\xxx-x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xxxxx.xxxxxxxxxxxxxxxxxn\lib\net40\Xxxxxxxx.xxxxxxxxxxxxxxxxxxxxxxxxxx.dll|C:\Dev\xxxxx\xxx-xxxxx-xx\packages\Xxxxxxxx.xxxxxxxxxxxxxxxxxn\lib\net40\Xxxxxxxx.xxxxxxxxxxxxxxxxxx.dll|C:\Dev\xxxxx\xxx-xxxxx-xx\packages\Xxxxxxxx.xxxxxxxxxxxxxxs\lib\net40\Xxxxxxxx.xxxxxxxxxxxxxxxxxxxxxxx.dll|C:\Dev\xxxxx\xxx-xxxxx-xx\packages\Xxxxxxxx.xxxxxxxxxxxxxxs\lib\net40\Xxxxxxxx.xxxxxxxxxxxxxxx.dll|C:\Dev\xxxxx\xxx-xxxxx-xx\packages\Xxxxxxxx.xxxxxxxxxxxxxxxxxxxxxxxxl\lib\net40\Xxxxxxxx.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.dll|C:\Dev\xxxxx\xxx-xxxxx-xx\packages\Xxx.xxxxxxxm\lib\Xxx.xxxxxxxxxxxxxxxxxxxxxx.dll|C:\Dev\xxxxx\xxx-xxxxx-xx\packages\Xxx.xxxxx\lib\net40\Xxx.xxxxxxxxxxxxxxx.dll|C:\Dev\xxxxx\xxx-xxxxx-xx\packages\Xxx.xxxxx\lib\net40\Xxx.xxxxxxxxxxxx.dll|C:\Dev\xxxxx\xxx-xxxxx-xx\packages\Xxx.xxxxx\lib\net40\Xxx.xxxxxxxxxxxxxxx.dll|C:\Dev\xxxxx\xxx-xxxxx-xx\packages\Xxx.xxxxx\lib\net40\Xxx.xxxxx.dll|C:\Dev\xxxxx\xxx-xxxxx-xx\packages\Xxx.xxxxx\lib\net40\Xxx.xxxxxxxxxxxx.dll|C:\Dev\xxxxx\xxx-xxxxx-xx\packages\Xxx.xxxxx\lib\net40\Xxx.xxxxxxxxxxxxxx.dll|C:\Dev\xxxxx\xxx-xxxxx-xx\packages\Xxx.xxxxx\lib\net40\Xxx.xxxxxxxxxxxxxxxx.dll|C:\Dev\xxxxx\xxx-xxxxx-xx\packages\Xxx.xxxxx\lib\net40\Xxx.xxxxxxxxxxxxxxxxxxxxxxxxxxxxx.dll|C:\Dev\xxxxx\xxx-xxxxx-xx\packages\Xxx.xxxxx\lib\net40\Xxx.xxxxxxxxxxxxxxxx.dll|C:\Dev\xxxxx\xxx-xxxxx-xx\packages\Xxx.xxxxx\lib\net40\Xxx.xxxxxxxxxxx.dll|C:\Dev\xxxxx\xxx-xxxxx-xx\packages\Xxx.xxxxx\lib\net40\Xxx.xxxxxxxxxxxxxxxxx.dll|C:\Dev\xxxxx\xxx-xxxxx-xx\packages\Xxx.xxxxx\lib\net40\Xxx.xxxxxxxxxxxxxxxxxxxx.dll|C:\Dev\xxxxx\xxx-xxxxx-xx\packages\Xxx.xxxxx\lib\net40\Xxx.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.dll|C:\Dev\xxxxx\xxx-xxxxx-xx\Xxx.xxxxxxxxxxxxxxxxxxxxxxxxxxs\bin\Release\Xxx.xxxxxxxxxxxxxxxxxxxxxxxxx.dll|C:\Dev\xxxxx\xxx-xxxxx-xx\Xxx.xxxxxxxxxxxxxxxxxxxxxxs\bin\Release\Xxx.xxxxxxxxxxxxxxxxxxxxx.dll|C:\Dev\xxxxx\xxx-xxxxx-xx\Xxx.xxxxxxxxxxxxxxxxxxxxl\bin\Release\Xxx.xxxxxxxxxxxxxxxxxxxxx.dll|C:\Dev\xxxxx\xxx-xxxxx-xx\packages\Xxx.xxxxx\lib\net40\Xxx.xxxxxxxxxxxxxxxxxxxx.dll|C:\Dev\xxxxx\xxx-xxxxx-xx\packages\Xxx.xxxxx\lib\net40\Xxx.xxxxxxxxxx.dll|C:\Dev\xxxxx\xxx-xxxxx-xx\packages\Xxx.xxxxx\lib\net40\Xxx.xxxxxxxxxxxxxxxxxxxxx.dll|C:\Dev\xxxxx\xxx-xxxxx-xx\packages\Xxx.xxxxx\lib\net40\Xxx.xxxxxxxxxxxxxxxx.dll|C:\Dev\xxxxx\xxx-xxxxx-
The issue has been fixed in PostSharp 4.2.14. Please update to the latest version.

specflow plugin with nunit and TFS build

I am in the middle of trying to get specflow UI tests working with TFS build and I am very very close.
I wanted to be able to run the same test on a number of browsers, and so after some research I found this:
http://www.baseclass.ch/blog/Lists/Beitraege/Post.aspx?ID=4&mobile=0
And it works like a dream for local test runs. the next step was to get this to call a selenium grid during a TFS 2010 build.
After getting the nunit community build task into my build template, I am now stuck with an error I can't seem to resolve. The build reports the following error:
Error: The system cannot find the file specified. Stack Trace: at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo) at System.Diagnostics.Process.Start() at TfsBuildExtensions.Activities.CodeQuality.NUnit.RunProcess(String fullPath, String workingDirectory, String arguments) in d:\Projects\CodePlex\teambuild2010contrib\CustomActivities\Legacy\VS2010\Source\Activities\CodeQuality\NUnit\NUnit.cs:line 339 at TfsBuildExtensions.Activities.CodeQuality.NUnit.PublishMSTestResults(String resultTrxFile, String collectionUrl, String buildNumber, String teamProject, String platform, String flavor) in d:\Projects\CodePlex\teambuild2010contrib\CustomActivities\Legacy\VS2010\Source\Activities\CodeQuality\NUnit\NUnit.cs:line 394 at TfsBuildExtensions.Activities.CodeQuality.NUnit.PublishTestResultsToTFS(ActivityContext context, String folder) in d:\Projects\CodePlex\teambuild2010contrib\CustomActivities\Legacy\VS2010\Source\Activities\CodeQuality\NUnit\NUnit.cs:line 387 at TfsBuildExtensions.Activities.CodeQuality.NUnit.InternalExecute() in d:\Projects\CodePlex\teambuild2010contrib\CustomActivities\Legacy\VS2010\Source\Activities\CodeQuality\NUnit\NUnit.cs:line 299 at TfsBuildExtensions.Activities.BaseCodeActivity.Execute(CodeActivityContext context) in d:\Projects\CodePlex\teambuild2010contrib\CustomActivities\Legacy\VS2010\Source\Common\BaseCodeActivity.cs:line 67.
however, this seems to be masking a deeper error as to me it simply says that nunit can't load a custom assembly. So I had a look through the binaries folder on the build server for the nunit logs, and sure enough in my test run .xml file I find another error:
System.Configuration.ConfigurationErrorsException : The type 'OpenQA.Selenium.Remote.RemoteWebDriver, Baseclass.Contrib.SpecFlow.Selenium.NUnit.SpecFlowPlugin' could not be found. It may require assembly qualification, e.g. "MyType, MyAssembly".
at Autofac.Configuration.ConfigurationRegistrar.LoadType(String typeName, Assembly defaultAssembly)
at Autofac.Configuration.ConfigurationRegistrar.RegisterConfiguredComponents(ContainerBuilder builder, SectionHandler configurationSection)
at Autofac.Configuration.ConfigurationRegistrar.RegisterConfigurationSection(ContainerBuilder builder, SectionHandler configurationSection)
at Autofac.Configuration.Core.ConfigurationModule.Load(ContainerBuilder builder)
at Autofac.Module.Configure(IComponentRegistry componentRegistry)
at Autofac.ContainerBuilder.Build(IComponentRegistry componentRegistry, Boolean excludeDefaultModules)
at Autofac.ContainerBuilder.Build(ContainerBuildOptions options)
at RegistrationForm.Tests.Acceptance.Features.UserRegistrationFeature.FeatureSetup() in c:\Builds\1\Testing\RegistrationForm - Nightly - Main\Sources\Testing\RegistrationForm\Main\RegistrationForm.Tests.Acceptance\Features\UserRegistration.feature.cs:line 0
From this I started to look at the path to the custom assembly. This is specified in the app.config file for the project (which is transformed during the build. I also checked to ensure the file is being transformed, and in the binaries directory on the build server it is). the relevant section of the file is this.
<specFlow>
<stepAssemblies>
<stepAssembly assembly="SpecFlow.Assist.Dynamic" />
<stepAssembly assembly="Baseclass.Contrib.SpecFlow.Selenium.NUnit.Bindings" />
</stepAssemblies>
<unitTestProvider name="SeleniumNUnit" />
<plugins>
<add name="Baseclass.Contrib.SpecFlow.Selenium.NUnit" path="..\packages\Baseclass.Contrib.SpecFlow.Selenium.NUnit.1.2.0\tools" />
</plugins>
Which works locally. I figured I just need to change the path in the transformed file. At first I assumed the working directory was the binaries directory so in the transform file I have this:
<specFlow>
<plugins xdt:Transform="Replace">
<add name="Baseclass.Contrib.SpecFlow.Selenium.NUnit" path="." />
</plugins>
The dll is in the same dir (binaries) so I tried ".", "", ".\" - none of these worked. So after thinking a little more and reading the errors more carefully I thought I needed to look in the Sources folder on the build server. The Dll is in the packages folder (nuget package restore), and so the path should be the same as I use locally. this didn't work either. So what about a path relative to the ".feature" file throwing the error? this simply needed an extra "..\" - still no luck.
So i am at a bit of a loss, I feel I have tried all the paths i can think of, but my knowledge of specflow plugins and TFS build is letting me down. can anyone give me any pointers?
But the initial error is basically saying the TFSs nunit support cant find a file when it calls CreateProcess, and as you say it works for local test runs, so is it as simple as NUnit isn't installed on the machine that is running the test for you?
I got there in the end!
So somewhere along the lines of setting this up I endded up with something like this in my app.config:
<component
name="IE"
type="Baseclass.Contrib.SpecFlow.Selenium.NUnit.RemoteWebDriver, Baseclass.Contrib.SpecFlow.Selenium.NUnit.SpecFlowPlugin"
service="OpenQA.Selenium.Remote.RemoteWebDriver, WebDriver"
instance-scope="per-dependency">
<parameters>
<parameter name="browser" value="InternetExplorer" />
<parameter name="url" value="http://192.168.1.3:4444/wd/hub" />
</parameters>
</component>
The problem (as it says in the error) is that it could not find OpenQA.Selenium.Remote.RemoteWebDriver. I belive I saw this in one of the examples I found on the bassclass page. After changing it to OpenQA.Selenium.IWebDriver everything worked fine, and nUnit was able to run my specFlow tests on my TFS 2010 build server. I did hit another snag in that when the build tried to parse the results, it tried to use MSTest 11 rather than 10 (prob because I was using VS 2012). However, this TFS machine was just a proof of concept and was a windows 2008 32bit edition running on Virtual PC on windows 7. (I could therfor not run 64bit, and so could not install VS2012 on my build server). I resolved this by creating a new environment variable for MStest 11 and pointing it at MSTest 10. The entire process now works perfectly.

NUnit components for version 4.0.30319 of the CLR are not installed

I am trying to implement an automated build process. After the build, the unit tests on nunit-console.exe are run. The following error is displayed:
> c:\nunit_2.5.10\nunit-console.exe c:\builds\Output\bin\TDD.nunit /framework=4.0.30319 /nologo /trace=Off
ProcessModel: Default DomainUsage: Default
Execution Runtime: v4.0.30319
Unhandled Exception:
System.ArgumentException: NUnit components for version 4.0.30319 of the CLR are not installed
Parameter name: targetRuntime
at NUnit.Util.TestAgency.LaunchAgentProcess(RuntimeFramework targetRuntime, Boolean enableDebug)
at NUnit.Util.TestAgency.CreateRemoteAgent(RuntimeFramework framework, Int32 waitTime, Boolean enableDebug)
at NUnit.Util.TestAgency.GetAgent(RuntimeFramework framework, Int32 waitTime, Boolean enableDebug)
at NUnit.Util.ProcessRunner.Load(TestPackage package)
at NUnit.ConsoleRunner.ConsoleUi.Execute(ConsoleOptions options)
at NUnit.ConsoleRunner.Runner.Main(String[] args)
There is no nunit-agent.exe on the build machine. However, on my machine it is not even called, so I suppose it is not necessary.
Why is nunit-agent.exe required in some cases but not always required? What conditions should be satisfied so nunit-agent would not need to launch?
Edit: I have found one resource, which kind of describes how it works, but not quite well: http://www.nunit.org/index.php?p=nunit-agent&r=2.5.10. It says that it is launched when program needs to run under a different framework than the one being used by NUnit (which is the case, since NUnit is compiled for 2.0). However, on my machine the nunit-agent.exe does not run although conditions seem to be the same.
I ran into this same error and it was definitely solved by including nunit-agent.exe in the folder where nunit-console.exe was launched. The complete list of .exes and .dlls necessary to run a test successfully was:
nunit.core.dll
nunit.core.interfaces.dll
nunit.framework.dll
nunit.util.dll
nunit-agent.exe
nunit-console.exe
nunit-console-runner.dll
All files are packaged in the download available from nunit.org. As of this post, 2.6.3 is the current version. Documentation for the console runner can be found here. And the direct download for the zip file is here.
For a test assembly targeting .NET 4.5.1, the following statement will execute tests:
nunit-console.exe your-assembly.dll /framework=v4.5.1
Adding a "startup/supportedRuntime" configuration tag to nunit-console.exe.config solved it for me.
<startup useLegacyV2RuntimeActivationPolicy="true">
<supportedRuntime version="v4.0.30319" />
</startup>
Try using Fusion to see what assembly might be missing and where the .exe is looking.
http://msdn.microsoft.com/en-us/library/e74a18c4(v=vs.110).aspx

NUnit-console 2.5.4 not capable of running multiple assemblies?

I am having problems running tests with the command line NUnit test runner.
I am using version 2.5.4 with .NET 4 on an x64 machine.
Using the following line results in a failure "Could not load file or assembly 'bar' or one of
its dependencies. The system cannot find the file specified."
nunit-console-x86 foo.dll bar.dll /framework=4.0.30319
If I reverse the dll file names it complains about not finding 'foo' instead...
It works if I run them separately like:
nunit-console-x86 foo.dll /framework=4.0.30319
Also the tests of the second file works if I run:
nunit-console-x86 bar.dll /framework=4.0.30319
Before upgrading our projects to 4.0 we used NUnit 2.5.2 and the same command line tool options and at that point the runner worked well with multiple assemblies. It seems like the ability to run tests on multiple files at the same time is broken...
Anyone that can see the same behavior or does it work indicating that my environment is somehow broken?
/Per
Assembly loading behaviour has changed between 2.5.4 and 2.5.3. It was causing problems for us, so we reverted to 2.5.3, since that still supports the 4.0 framework.
We use nunit-console.exe 2.5.3 with multiple assemblies in our msbuild script, which looks like this:
<Exec Command="%22$(NUnit_Install_Directory)bin\net-2.0\nunit-console.exe%22
/noshadow #(TestableAssemblies, ' ') /xml $(BuildFilesPath)\NUnit-Results.xml" />
On execution, it fills out like this (edited for readability):
"c:\Program Files\NUnit 2.5.3\bin\net-2.0\nunit-console.exe" /noshadow D:\BuildAgent\GojiSoft.Application.Test\bin\Release\GojiSoft.Application.Test.dll D:\BuildAgent\GojiSoft.Common.Test\bin\Release\GojiSoft.Common.Test.dll
/xml D:\BuildAgent\work\2f016459feee51ce\Build\NUnit-Results.xml
We don't use a 64bit machine for our unit tests, so YMMV.
I have a blog post about the addtional modification your should make to the nunit-console-x86.exe.config here: Getting .Net 4.0, Team City, MSBuild and Nunit to play nice.
I has the same problem. I got around it by creating an nunit project in the GUI that includes multiple dlls. Then I can run it with nunit-console.

NUnit assembly not found

I've used NUnit before, but not in a while, and never on this machine. I unzipped version 2.4.8 under Program Files, and I keep getting this error when trying to load my tests.
Could not load file or assembly 'nunit.framework, Version=2.4.8.0, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77' or one of its dependencies. The system cannot find the file specified**
In order to simplify the problem, I've compiled the most basic possible test file.
using NUnit.Framework;
namespace test
{
[TestFixture]
public class Tester
{
[Test]
public void ATest()
{
Assert.IsTrue(false, "At least the test ran!");
}
}
}
I've added "C:\Program Files\NUnit-2.4.8-net-2.0\bin" to my PATH (and rebooted). Note that if I copy the test assembly into that folder, then
C:\Program Files\NUnit-2.4.8-net-2.0\bin>nunit-console test.dll
works, but
C:\Program Files\NUnit-2.4.8-net-2.0\bin>nunit-console c:\dev\nunit_test\test.dll
and
C:\dev\nunit_test>nunit_console test.dll
fail with the above error.
Presumably I could get around this by copying the NUnit.Framework DLL file into my project's bin folder, but I don't remember having to do this in the past. Moreover, I get the same error in the GUI. Shouldn't the GUI know where the framework is located (that is, in the same folder)?
I'm not using Visual Studio. I use the following line to compile the test project.
%windir%\Microsoft.NET\Framework\v2.0.50727\csc.exe /r:"C:\Program Files\NUnit-2.4.8-net-2.0\bin\nunit.framework.dll" /t:library /out:test.dll test.cs
I tried both the .msi and the .zip file with the same result.
Make sure you have added a reference to nunit.framework. If you have, then make sure the properties of that reference have the copy local property set to true.
I had the same problem, and I had installed using NUnit-2.4.8-net-2.0.msi. Expanding on the "add to the GAC" comment, here's what I did:
Open your "Visual Studio command prompt (generally: make sure gacutil is in your path) and: cd "C:\Program Files\NUnit 2.4.8\bin"
Unregister your NUnit entries from the GAC. You can do this by finding the NUnit entries registered in the GAC:
gacutil /l | find /i "nunit" > temp.bat && notepad temp.bat
Prepend the nunit.core and nunit.framework lines with "gacutil /uf", i.e.:
gacutil /uf nunit.core,Version=2.4.2.0,Culture=neutral,PublicKeyToken=96d09a1eb7f44a77
gacutil /uf nunit.framework,Version=2.4.2.0,Culture=neutral,PublicKeyToken=96d09a1eb7f44a77
Run your .bat file to remove them:
temp.bat
Register the NUnit DLL files you need:
gacutil /i nunit.core.dll
gacutil /i nunit.framework.dll
If you install using NUnit-2.4.8-net-2.0.msi, the NUnit assemblies are added to the GAC.
You can also reinstall manually by running gacutil from the Visual Studio 2005 command prompt.
Note that the current NUnit installation (2.5.10) doesn't register itself automatically in the GAC.
If you must use GAC, register it via gacutil /i <nunitframeworkpath> where nunitframeworkpath is usually %Program Files%\NUnit\net-2.0\framework\nunit-framework.
I got this error message today when I tried to add a new test assembly to an existing NUnit test project. It seems that my test projects had multiple path references to identical nunit.framework.dll assemblies.
If you have more than one test assembly in your NUnit project, you may want to verify the Path property of the nunit.framework reference in your test projects. Once I made them match, the error message went away.