Search code examples
c#asp.net-mvcvisual-studiovisual-studio-2017live-unit-tests

Could not load file or assembly 'Microsoft.CodeAnalysis.LiveUnitTesting.Runtime, version= 1.7.0.0' with visual studio 2017


I started live unit testing with visual studio 2017 (15.7.1). After I switch the branch and start the project, an error message comes up saying the following:

Could not load file or assembly 'Microsoft.CodeAnalysis.LiveUnitTesting.Runtime, version= 1.7.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependenc

enter image description here

I tried to:
- rebuild/restart the project
- stop live unit testing
but it didn't work.

I don't know why load 'Microsoft.CodeAnalysis.LiveUnitTesting.Runtime' from project/bin.
Anyone have a suggestion?


Solution

  • Finally, I stop live unit test and delete Persisted Data. It works now.

    Step 1. Stop unit test enter image description here

    Step 2. Test → Live Testing → Options... enter image description here

    Step 3. delete Persisted Data enter image description here

    Step 4. Delete all folder under package folder, and then re-build Solution, it works.

    hm... I still don't know why load from project/bin after changing branch :S.