/framework switch does not recognize net-4.5

Bug #1222148 reported by Andy
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
NUnit Framework
Fix Released
High
Charlie Poole
NUnit V2
Fix Released
High
Charlie Poole

Bug Description

I'm attempting to get some unit tests run using nunit-console with the /framework:net-4.5 switch. The console continues to throw an exception. This is the output its giving:

ProcessModel: Default DomainUsage: Single
Execution Runtime: net-4.5
Unhandled Exception:
System.ArgumentException: The net-4.5 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)

The same source base is also building and running under 3.5 and 4.0 which work as expected. I'm fairly certain that 4.5 is installed correctly on the computer in question. This is using nunit 2.6.1 on windows 7 64 bit.

*****
based on a discussion group question from 8/29/2013

Related branches

Revision history for this message
Charlie Poole (charlie.poole) wrote :

I'd appreciate it if you would try two different workarounds.

1. Use /framework:net-4.0 since 4.5 is simply 4.0 with some extra capabilities. I suspect your tests will run.

2. Don't use any switch at all. NUnit will analyze the test assembly and determine how it should be run.

I'll set the priority of the bug depending on how these experiments turn out.

Charlie

Revision history for this message
Andy (ajs-general) wrote :

The 4.0 work around is what I'm currently doing and that seems to work fine. The current assembly doesn't use anything really 4.5 specific so it will work for the short term. This does run it under 4.0.

When running with no /framework switch nunit runs under 3.5.

I did some reviewing of things and the original stack trace I reported above only occurs with nunit 2.6.1. With 2.6.2 and the /framework:4.5 switch the assembly runs as 3.5. I was incorrect in stating that the error was from 2.6.2. (I've updated the ticket as well)

description: updated
Revision history for this message
Charlie Poole (charlie.poole) wrote : Re: [Bug 1222148] Re: /framework switch does not recognize net-4.5

One more bit of info will help here: what is the target framework for
which your test assembly is built? NUnit analyzes the assembly in
order to decide how to run it when you don't specify a framework on
the command line.

On Mon, Sep 9, 2013 at 4:38 AM, Andy <email address hidden> wrote:
> The 4.0 work around is what I'm currently doing and that seems to work
> fine. The current assembly doesn't use anything really 4.5 specific so
> it will work for the short term. This does run it under 4.0.
>
> When running with no /framework switch nunit runs under 3.5.
>
> I did some reviewing of things and the original stack trace I reported
> above only occurs with nunit 2.6.1. With 2.6.2 and the /framework:4.5
> switch the assembly runs as 3.5. I was incorrect in stating that the
> error was from 2.6.2. (I've updated the ticket as well)
>
>
> ** Description changed:
>
> I'm attempting to get some unit tests run using nunit-console with the
> /framework:net-4.5 switch. The console continues to throw an
> exception. This is the output its giving:
>
> ProcessModel: Default DomainUsage: Single
> Execution Runtime: net-4.5
> Unhandled Exception:
> System.ArgumentException: The net-4.5 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)
>
> The same source base is also building and running under 3.5 and 4.0
> which work as expected. I'm fairly certain that 4.5 is installed
> - correctly on the computer in question. This is using nunit 2.6.2 on
> + correctly on the computer in question. This is using nunit 2.6.1 on
> windows 7 64 bit.
>
> *****
> based on a discussion group question from 8/29/2013
>
> --
> You received this bug notification because you are subscribed to NUnit
> Extended Testing Platform.
> https://bugs.launchpad.net/bugs/1222148
>
> Title:
> /framework switch does not recognize net-4.5
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/nunitv2/+bug/1222148/+subscriptions

Revision history for this message
Charlie Poole (charlie.poole) wrote :

Still waiting for an answer to the last question: for what target framework is the test assembly being built?

Changed in nunit-3.0:
status: New → Triaged
importance: Undecided → High
Changed in nunitv2:
status: New → Triaged
importance: Undecided → High
Changed in nunit-3.0:
assignee: nobody → Charlie Poole (charlie.poole)
milestone: none → 2.9.6
status: Triaged → Fix Released
Changed in nunitv2:
status: Triaged → Fix Committed
assignee: nobody → Charlie Poole (charlie.poole)
milestone: none → 2.6.3
Changed in nunitv2:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.