I got the same error today. I was trying to add log4net to my Tests project in VS2015.
I simply added a <log4net>
section in my app.config under <configuration>
(with subnodes appender, root, logger...). Then I got the error:
DisconnectedContext occurred
Message: Managed Debugging Assistant 'DisconnectedContext' has detected a problem in 'C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO 14.0\COMMON7\IDE\COMMONEXTENSIONS\MICROSOFT\TESTWINDOW\te.processhost.managed.exe'.
Additional information: Transition into COM context 0x1301ae0 for this RuntimeCallableWrapper failed with the following error: The object invoked has disconnected from its clients. (Exception from HRESULT: 0x80010108 (RPC_E_DISCONNECTED)). This is typically because the COM context 0x1301ae0 where this RuntimeCallableWrapper was created has been disconnected or it is busy doing something else. Releasing the interfaces from the current COM context (COM context 0x1301970). This may cause corruption or data loss. To avoid this problem, please ensure that all COM contexts/apartments/threads stay alive and are available for context transition, until the application is completely done with the RuntimeCallableWrappers that represents COM components that live inside them.
Also, in the Debug output, there was a useful message about a ConfigurationErrorsException:
------ Run test started ------
NUnit VS Adapter 2.0.0.0 executing tests is started
Loading tests from C:\....Tests.dll
Exception System.Configuration.ConfigurationErrorsException, Exception thrown executing tests in C:\....\Tests.dll
NUnit VS Adapter 2.0.0.0 executing tests is finished
========== Run test finished: 0 run (0:00:46.9507369) ==========
I realized you also need to add a <section>
declaration in <configSections>
:
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net"/>
After adding this, the error went away. Not sure if this relates to your error, but it might help.