Re: 2.4.6 ConsoleUI.Execute() fails at Util.TestDomain.Load(): Object Reference Not set

"Charlie Poole" <[email protected]>
Newsgroups gmane.comp.windows.dotnet.nunit.user
Message-ID <015201c87990$8bb0cb10$6401a8c0@ferrari>
Hello Quan,
 
First let me point out - as you are probably aware - you are using NUnit
internal calls, which may change
from version to version, requiring that you modify your code.
 
In this case, you are bypassing the entire main program of NUnit-console,
which previously did little
more than create the ConsoleOptions, but now does other things. In
particular, it sets up various
services that are used by the tests. Since this setup is being bypassed,
NUnit is finding that some
of its central services don't exist.
 
There are two remedies, which I will call the "easy" way and the "harder"
way.
 
1. The easy way is to stop bypassing NUnit's code and simply call NUnit's
own main, like this
          Runner.Main( args );
   I think you should do this unless there is some reason not to - that is,
if you are doing
   some further processing not shown in your example.
 
2. The harder way is to examine the code in NUnit that calls
ConsoleUi.Execute and imitate
  what it is doing - especially being sure to set up the required services.
 
Charlie


  _____  

From: [email protected]
[mailto:[email protected]] On Behalf Of Quan T
Sent: Wednesday, February 27, 2008 1:41 PM
To: [email protected]
Subject: [Nunit-users] 2.4.6 ConsoleUI.Execute() fails at
Util.TestDomain.Load(): Object Reference Not set



Hi

We've been using NUnit 2.4.1 and 2.4.3 for our NUnit tests written for .NET
2. The way we launch into NUnit is via this C# code snippet:

 

                ConsoleOptions options = new ConsoleOptions(true, args);

                ConsoleUi nunit = new ConsoleUi();

                nunit.Execute(options);

 

This has worked well in both 2.4.1 and 2.4.3, until we try the latest
version 2.4.6. After updating all NUnit references etc and run the program,
it keeps failing at the nunit.Execute() line with this exception:

"Object reference not set to an instance of an object"

   at NUnit.Util.TestDomain.Load(TestPackage package)

   at NUnit.ConsoleRunner.ConsoleUi.MakeRunnerFromCommandLine(ConsoleOptions
options)

   at NUnit.ConsoleRunner.ConsoleUi.Execute(ConsoleOptions options)

 

Hope someone has an idea why.

 

Thanks

-q


  _____  

Need to know the score, the latest news, or you need your HotmailR-get your
"fix". Check it  <http://www.msnmobilefix.com/Default.aspx> out.

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/

_______________________________________________
Nunit-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nunit-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.