I've been having this recurring problem with some of my .Net framework 4.5 and 4.6 and 4.7 projects not having their tests discovered by test explorer. The "tests" log output is showing:
The given assembly name or codebase was invalid. (Exception from HRESULT: 0x80131047)
That's all the info I have.
I've tried pretty much every combination of the different version of MSTest.Framework
and adapter and such. Just can't figure this one out. I've done the Test Extension cache clearing.
Test projects that are Coded UI tests or Web Load Tests are not compatible with MSTestV2. These project types have been deprecated.
To start debugging: In the Visual Studio editor, set a breakpoint in one or more test methods that you want to debug. Because test methods can run in any order, set breakpoints in all the test methods that you want to debug. In Test Explorer, select the test method(s) and then choose Debug on the right-click menu.
I had upgraded some of the projects to 4.6.2 and two of them had app.config files with specific assembly bindings.
Deleting both the app.config files fixed the problem for me - there were no other settings being used in the files so I just deleted rather than fixing the bindings.
I got the same issue. I am using VS 2017 and .Net Version 4.7. Though I made test runnable by adding Visual Studio Quality Tools and by removing MSTest framework and adapter packages, I am getting other issues like "Could not load System.Runtime"
Update: In my case, the root cause of getting this issue was deleting the <Target>
tag in the test project's .csproj file. I got missing file nuget package error and resolved that issue as suggested here. Unfortunately it has a side effect that made my test methods non discover-able
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With