TLDR; change the project location on disk from shared mac (my documents) to local windows (c:-drive) to prevent Live unittesting from crashing
Live unit testing has been introduced in 2016 (visual studio blog) and got my attention recently by a tweet from Iris Classon.
Why haven’t I used live unit testing before? I’m saving time, writing better tests, testing more scenarios.. etc. S… twitter.com/i/web/status/9…—
Iris Classon (@IrisClasson) December 20, 2017
Since I’m on a Mac my way of working with Visual Studio is with virtualisation. I have Windows 10 running in Parallels Desktop and installed Visual Studio 2017 enterprise. The enterprise version contains the live unit testing feature. If you don’t see it check the version of VS2017 you’re running.
After creating a simple solution with some unit tests I started the live unit testing feature. This can be done in the menu Test > Live unit testing > Start. The output window showed it was compiling and then the thing crashed … Microsoft.CodeAnalysis.LiveUnitTesting has stopped working …
I’ve noticed strange behaviour before when the projects are located in the my documents folder. This is the default location for visual studio projects. In Parallels this location is mapped to the documents folder of the Mac user on the host machine. Windows 10 sees this as a network / mapped drive location and does not trust it by default.
I moved the solution to the local c:-drive and got live unit testing to work without problems. Loving it already. Got to agree with Iris about this one.