0

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?

pappy
  • 43
  • 7
  • Does [this](https://stackoverflow.com/questions/50223282/tfs-tests-do-not-match-framework-settings) help? – nilsK Nov 20 '20 at 13:28
  • 1
    I'm on 16.8.2, on a 64-bit Win10 machine and I don't get that error if I follow the steps you describe. I even tried using a runsettings file that has TargetPlatform x86 and TargetFrameworkVersion FrameworkCore10. That still ran the tests fine and broke in debug fine. Not much help, sorry, but does at least show it's something to do with your setup. – Rich N Nov 20 '20 at 13:31
  • Yep, I try my home PC and it works fine. But my work computer has the issue. I am just using the template and not writing any code. Project settings should be already ok. What other test settings should I check? – pappy Nov 20 '20 at 14:11
  • Just installed the next preview of Visual Studio and it seems to be working fine. I would still like to know what the problem is with my current Visual Studio – pappy Nov 20 '20 at 16:45
  • @nilsK none of that seems to apply to my case, sorry – pappy Nov 20 '20 at 17:54
  • 1
    @pappy try to start Visual Studio in [safe mode("devenv /SafeMode")](https://learn.microsoft.com/en-us/visualstudio/ide/reference/safemode-devenv-exe?view=vs-2019), or disable your visual studio extensions. – Xingyu Zhao Nov 23 '20 at 08:40
  • Thank you all for trying to help me. My Visual Studio had been through so many updates I decided to reinstall Visual Studio from scratch and now everything is fine. – pappy Nov 23 '20 at 11:37

1 Answers1

1

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

pappy
  • 43
  • 7
  • Do not forget to [mark your own answer](https://stackoverflow.blog/2009/01/06/accept-your-own-answers/):) – Mr Qian Nov 26 '20 at 07:22