← Back to team overview

nunit-core team mailing list archive

[Bug 896615] Re: Tests can't be run in existing AppDomain

 

You are right that the code in question is incorrect. NUnit only uses
TestLoader for the Gui, which cannot  run with DomainUsage.None, so this
was never noticed before.

OTOH, the code you suggest doesn't work for all cases. What's intended
is to prevent both ProcessModel and DomainUsage from being set to
Multiple, which requires

if ( (processModel != ProcessModel.Multiple || domainUsage != DomainUsage.Multiple)
                && !package.Settings.Contains("DomainUsage"))
                package.Settings["DomainUsage"] = domainUsage;

I'm torn here. On the one hand, I'd like to fix this for you but on the
other, I'm tempted to add 'domainUsage != domainUsage.None' to the
statement, so that the Gui won't crash. I'll look to see if I can put
that test in the Gui itself.

** Changed in: nunitv2
       Status: Triaged => Fix Committed

-- 
You received this bug notification because you are a member of NUnit
Developers, which is subscribed to NUnit V2.
https://bugs.launchpad.net/bugs/896615

Title:
  Tests can't be run in existing AppDomain

Status in NUnit V2 Test Framework:
  Fix Committed

Bug description:
  If I set Options.TestLoader.DomainUsage as DomainUsage.None and set Options.TestLoader.ProcessModel = ProcessModel.Single, test-doman-* AppDomain created otherwise, because these parameters set to Default.
  It seems that problem is inside method TestLoader::MakeTestPackage in this code:

  if (processModel != ProcessModel.Multiple && domainUsage == DomainUsage.Multiple
                  && !package.Settings.Contains("DomainUsage"))
                  package.Settings["DomainUsage"] = domainUsage;

  Does the code needs to be changed to the following code?

  if (processModel != ProcessModel.Multiple && domainUsage != DomainUsage.Multiple
                  && !package.Settings.Contains("DomainUsage"))
                  package.Settings["DomainUsage"] = domainUsage;

To manage notifications about this bug go to:
https://bugs.launchpad.net/nunitv2/+bug/896615/+subscriptions


References