Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

DisconnectedContext error when running Unit Tests in debug in VS2015

I have this problem with running unit tests in VS2015 Enterprise. Whenever I run any unit test in debug mode, I get the following error:

Managed Debugging Assistant 'DisconnectedContext' has detected a problem in 'my_path_to_VS\COMMON7\IDE\COMMONEXTENSIONS\MICROSOFT\TESTWINDOW\te.processhost.managed.exe'.

I tried running repair on VS2015 and it did not help. Tried uninstalling and installling again and the issue persist. The strange thing that I have a code on SVN and my friend in able to run the same code in debug on his machine without any issues.

Just running the test (without debugger) works without any problems.

I do have a ReSharper installed. Could that be causing this issue?

UPDATE Ok so Resharper is causing this issue. This issue only happens when I am running the test through the ReSharper icon (next to the TestMethod name). When I do Test->Debug->All Tests it runs fine. Any ideas? Maybe ReSharper bug?

like image 692
NeverStopLearning Avatar asked Aug 27 '15 08:08

NeverStopLearning


3 Answers

I also have Rashaper and faced with this problem, no matter from where I am calling the tests (VS or Resharper). I've overcome this by changing the target architecture of the tests and the projects to the x64. But the source of the problem is still unknown for me. Settings

like image 154
shfire Avatar answered Nov 03 '22 02:11

shfire


I had this exception while debugging a WCF service in Visual Studio 2015. No usage of ReSharper. Changing the default architecture as suggested by shfire to X64 fixed it for me.

Because my project is a migrated Visual Studio 2012 project I compared the default processor architecture with the settings in VS2012. In VS2012 the default architecture isn't selected or selectable! I think this is a new bug and/or feature of VS2015 ;-)

like image 27
Dirk Brockhaus Avatar answered Nov 03 '22 03:11

Dirk Brockhaus


Check if you set the compiler to "Release" instead of "Debug". That solved the issue for me!

like image 44
Hunv Avatar answered Nov 03 '22 01:11

Hunv