question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Tests fail to run for UWP projects with Minimum Versions set to RS2 (15063) or earlier - Regressed with TestAdapter 2.2.1

See original GitHub issue

Description

Attempting to run tests for a UWP unit test project with Minimum Version set to RS2 (15063) or earlier fails with an error about not being able to load System.Xml.ReaderWriter. This regressed starting with MSTest.TestAdapter version 2.2.1. It reproes both in and outside of Visual Studio.

Steps to reproduce

  1. Create a C# UWP test project. This brings up a wizard where you select two values. You can leave “Target Version” set to the default, but for “Minimum Version” change it to “Windows 10 Creators Update (10.0; Build 15063)”. Anything older will repro the issue as well.
  2. Manage NuGet Packages for the project and update the version used for MSTest.TestAdapter to 2.1.2.
  3. Build the project and run all tests, it should work fine.
  4. Go back to Manage NuGet Packages and update the version used for MSTest.TestAdapter to 2.2.1 or anything newer.
  5. Rebuild and run all tests again.

Expected behavior

The test should pass.

Actual behavior

The test fails to run, with the following error listed in the Test pane of the output window:

An exception occurred while invoking executor 'executor://mstestadapter/v2': Could not load file or assembly 'System.Xml.ReaderWriter, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

Environment

  • Operating system: Win10, repro’d on various versions between RS5 and 21H1
  • Build version of vstest.console: Repro’d with 16.10.0-release-20210520-03 and 16.11.0-release-20210626-04
  • Package version of MSTest.TestAdapter: 2.2.1 - 2.2.5

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
Evangelinkcommented, Nov 29, 2022

After discussion with management we agreed on doing nothing as the issue is quite old and the number of impacted users is quite low.

0reactions
Evangelinkcommented, Nov 29, 2022

I did some investigation and indeed there were some implicit breaking change done by updating Test Platform. It’s going to be too complex to do any fix on older versions because of all the other changes…

On MSTest v3, I have made it explicit that we are dropping some older target frameworks that are no longer supported (see https://github.com/microsoft/testfx/issues/1274#issue-1383430926).

I will discuss with management to see what options we could provide but I guess the only suitable at the moment is for you to stay on the older version that was still supporting UWP version you want to target.

Read more comments on GitHub >

github_iconTop Results From Across the Web

No test found. Make sure that installed test discoverers & ...
I am in the process of upgrading our existing solution to .Net 4.6.1 and have been unable to get our unit tests to...
Read more >
UWP Unit Tests fail to run - Developer Community
I created a UWP app and a UWP test app, added a UWP class library, and then a test case to test one...
Read more >
Visual Studio Testing - Microsoft Q&A
Now I create a UWP Unit Test project that references the above three projects. When I click Run All Tests under Test, the...
Read more >
UWP tests with minimum version lower than 16299 and higher ...
If you try to run UWP unit-test with minimum target version lower than ... UWP.v10240.v17134.exe] Failed to discover tests from assembly ...
Read more >
2018 ~ Matt Lacey
Update the project to have references to the reference app and the comparison app. Run the tests in the test project. They:.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found