← Back to team overview

nunit-core team mailing list archive

[Bug 578702] Re: STA shutdown causes DisconnectedContext

 

Auto bug expiry isn't working, so I'm closing this manually.

** Changed in: nunit-3.0
       Status: Incomplete => Won't Fix

-- 
You received this bug notification because you are a member of NUnit
Core Developers, which is the registrant for NUnit Framework.
https://bugs.launchpad.net/bugs/578702

Title:
  STA shutdown causes DisconnectedContext

Status in NUnit Test Framework:
  Won't Fix

Bug description:
  NUnit 3.5.5, VS2005, .Net framework 2
Test fixture attributed "RequiresSTA".  Test creates COM objects wrapped in Runtime-Callable Wrappers (RCWs).  Tests complete OK but immediately afterwards I see:
"Managed Debugging Assistant 'DisconnectedContext' has detected a 
problem in 'C:\Program Files\NUnit 2.5.5\bin\net-2.0\nunit.exe'. 
Additional Information: Context 0x19a1c8' is disconnected.  Releasing 
the interfaces from the current context (context 0x19a110).This may 
cause corruption or data loss. To avoid this problem, please ensure 
that all contexts/apartments stay alive until the applicationis 
completely done with the RuntimeCallableWrappers that represent COM 
components that liveinside them." 

Suggestion is that NUnit shuts down the STA in which the tests run _before_ the RCWs are finalized.

Work-rounds are to avoid marking the fixture as "RequiresSTA", or to add a GC.Collect() in the TestFixtureTearDown.





References