首页 > 解决方案 > 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?

标签: c#visual-studiounit-testingvisual-studio-extensions

解决方案


重新安装 Visual Studio 提供了一种补救措施,但原始问题将不为人知。


推荐阅读