It would be helpful if you could include a minimal test that
demonstrates the problem.

** Changed in: nunit-3.0
   Importance: Undecided => Medium

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

Status in NUnit Test Framework: New

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.



_______________________________________________
Mailing list: https://launchpad.net/~nunit-core
Post to     : nunit-core@lists.launchpad.net
Unsubscribe : https://launchpad.net/~nunit-core
More help   : https://help.launchpad.net/ListHelp

Reply via email to