Post

How to Upgrade xUnit.net Projects to 2.2.0

This post is about how to upgrade xUnit.net projects to 2.2.0.

You already know Obfuscar uses xUnit.net for unit testing. It was a .NET Framework 4.5 Class Library project. So now I simply upgraded its xUnit.net dependencies to latest 2.2.0 release, and wow Visual Studio 2017 refuses to show the test cases in Test Explorer.

So what’s up? Well, many small pieces.

  • You have to upgrade the project to at least .NET Framework 4.5.2. I don’t know why.
  • You have to manually change one reference from xunit.execution.dotnet to xunit.execution.desktop. I don’t know why the upgrade process chooses a wrong reference.

So the final project is as below.

Hope this can save you a few minutes when you hit the same issue.

© Lex Li. All rights reserved. The code included is licensed under CC BY 4.0 unless otherwise noted.
Advertisement