NUnit fail with System.ArgumentException: The net-4.0 framework is not available
Asked Answered
B

2

10

Exception: ProcessModel: Default DomainUsage: Single Execution Runtime: net-4.0 Unhandled Exception: System.ArgumentException: The net-4.0 framework is not available Parameter name: framework 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)

OS Winserver 2008 R2 x64

Nunit 2.5.4.10098

Test assembly Built for .net 4.0 RTM (v4.0.30319)

Commandline nunit-console.exe NServiceBus.Config.UnitTests.dll /framework=net-4.0

Any ideas?

Brause answered 14/4, 2010 at 8:6 Comment(0)
L
14

Combine Kev's advice ( add /framework=4.0.30319 to the parameter list) and modify nunit-console.exe.config with the following:

under

 <configuration>

add:

<startup>  <requiredRuntime version="v4.0.30319" /></startup>

under <configuration><runtime> add:

 <legacyUnhandledExceptionPolicy enabled="1" />
Latticework answered 14/4, 2010 at 12:14 Comment(1)
That did it, thanks! Had to add: <loadFromRemoteSources enabled="true" /> to the runtime section as well though!Fragmental
B
1

I was having the same issue with CC.net.

I now run NUnit from NAnt using the arguement /framework=4.0.30319

Hope this helps

Kev

Bookstand answered 14/4, 2010 at 11:47 Comment(1)
Thanks, that got me further but now I get this error instead: System.NullReferenceException: Object reference not set to an instance of an object. [exec] at NUnit.Util.ProcessRunner.Load(TestPackage package) [exec] at NUnit.Core.ProxyTestRunner.Load(TestPackage package) [exec] at NUnit.Util.RemoteTestAgent.AgentRunner.Load(TestPackage package) [exec] at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Ob ct server, Int32 methodPtr, Boolean fExecuteInContext, Object[]& outArgs) Full dump here: pastie.org/919114Fragmental

© 2022 - 2024 — McMap. All rights reserved.