HI Bryan,
On Tue, Apr 27, 2010 at 12:01 PM, Bryan Call <
bryan...@gmail.com> wrote:
> I've got a stupid question for you. I'm trying to get the /framework
> flag to work to force nunit 2.5.5 to run under .net 4 and I'm having
> trouble. Here is what I've tried:
>
> nunit.exe /framework=net-4.0 unittests.dll
> nunit.exe /framework:net-4.0 unittests.dll
> nunit.exe /framework:4.0.30319 unittests.dll
> nunit.exe /framework=4.0.30319 unittests.dll
>
> All of them give me an invalid argument error (it pops up the command
> line argument help dialog which doesn't list /framework as an
> option).
Not surprisingly, the help display is right. :-) There is no
/framework option to
the nunit.exe command - although there is one for nunit-console. The gui
runner does not need one because it has other ways - such as the File
menu - to load the test using a given framework. By default, as you
have seen, it uses the framework version used in creating the test assembly.
> Here is what I'm trying to do. I want the NUnit gui to run a unit
> test assembly in the .NET 4 framework without running it in a separate
> process. I like to launch nunit from the debug settings in visual
> studio. This causes the process (nunit.exe) to be executed and then
> attaches the debugger to it automatically. As it is now nunit is
> running my assembly in a seperate process which is not the one visual
> studio automatically attaches to.
>
> I know I can manually attach to the correct process but I'm trying to
> get this to work automatically like I have done in the past and my
> understanding is the /framework flag should do that but I just can't
> get it to work right.
Try setting COMPLUS_Bersion to 'v4.0.30319' in the command that
you run in the debug settings. I think (but I haven't tried it) that it should
work if you use
set COMPLUS_Version=v4.0.30319&<your existing command>
If that does not work, you may need to run a .bat file instead.
[Note for others reading this: Do NOT do this unless you have the
exact issue that Bryan is talking about. It's only needed because
of the specific goal Bryan is trying to achieve.]
Bryan, this would make a reasonable feature request - some way
for NUnit to detect it is under the debugger and to (somehow)
force the alternate process to run under the debugger as well.
Charlie
nunit under the debugger.]