Search code examples
c#visual-studiounit-testingvisual-studio-extensions

Visual Studio 16.8.2 - Analyzer with Code Fix project template produces errors when trying to debug unit test


Start Visual Studio 16.8.2

Create a new "C# Analyzer with Code Fix project".

Build the project.

Run all tests and see they all pass.

Set a break point in the unit test file in TestMethod2.

Try to debug the test.

You get 4 warnings and inconclusive test results.

Here is the first warning:

2020.11.20 04:54:44.521 WARN Test run detected DLL(s) which were built for different framework and platform versions. Following DLL(s) do not match current settings, which are .NETCoreApp,Version=v1.0 framework and X64 platform. MyAnalyzerTest9.Test.dll is built for Framework .NETCoreApp,Version=v2.0 and Platform AnyCPU. Go to http://go.microsoft.com/fwlink/?LinkID=236877&clcid=0x409 for more details on managing these settings.

The link is to an article about "How to: Run a Unit Test as a 64-bit Process" written in 01/11/2013.

After hours of research I cannot figure out how to fix this. I tried updating the test packages but it did not help.

Can anyone help?


Solution

  • Reinstall Visual Studio provides a remedy however the original problem will not be known.