English 中文(简体)
Why is NUnit hanging from the command line, but not under TestDriven.NET?
原标题:

If I start my unit tests from TestDriven.NET under VS2008, they run pretty much immediately.

If I start my unit tests using nunit-console.exe, the NUnit console hangs for five minutes before actually running my tests. If I attach a debugger, it seems to be spending its time in System.IO.MemoryStream.Read, called from System.Runtime.Serialization.Formatters, called from System.Runtime.Remoting, on the other side of some native-managed transitions called by NUnit.Core.ProxyTestRunner.Test.get. Sometimes, it s in System.Runtime.Serialization.ObjectManager.RecordFixup or .FindObjectHolder.

This is with NUnit-2.5.2 on 32-bit XP, fully patched. All assemblies are targeted to .NET 2.0.

What is nunit-console up to? Is there any way to persuade it to not do it?

问题回答

I cannot be sure, since I am also lucky to use a new version. You probably have a huge test suite with lots of tests, aren t you? If you do not need application domain isolation for other reasons, you can turn it off and then you save the remoting/marshaling time.

Try this please and give feedback to us how it went:

nunit-console.exe /noshadow /nologo /process Single /domain None whatever.dll

There is also a way to add these options via the configuration files, if you do not want to touch your build scripts even with a stick. :)





相关问题
Manually implementing high performance algorithms in .NET

As a learning experience I recently tried implementing Quicksort with 3 way partitioning in C#. Apart from needing to add an extra range check on the left/right variables before the recursive call, ...

Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

How do I compare two decimals to 10 decimal places?

I m using decimal type (.net), and I want to see if two numbers are equal. But I only want to be accurate to 10 decimal places. For example take these three numbers. I want them all to be equal. 0....

Exception practices when creating a SynchronizationContext?

I m creating an STA version of the SynchronizationContext for use in Windows Workflow 4.0. I m wondering what to do about exceptions when Post-ing callbacks. The SynchronizationContext can be used ...

Show running instance in single instance application

I am building an application with C#. I managed to turn this into a single instance application by checking if the same process is already running. Process[] pname = Process.GetProcessesByName("...

How to combine DataTrigger and EventTrigger?

NOTE I have asked the related question (with an accepted answer): How to combine DataTrigger and Trigger? I think I need to combine an EventTrigger and a DataTrigger to achieve what I m after: when ...

热门标签