-
Notifications
You must be signed in to change notification settings - Fork 242
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tests fail to run for UWP projects with Minimum Versions set to RS2 (15063) or earlier - Regressed with TestAdapter 2.2.1 #927
Comments
Debugging observations: In the working case Framework assemblies (System.*) are being loaded from the CoreFramework app directory, for example System.Xml.ReaderWriter.dll is loaded from "C:\Program Files\WindowsApps\Microsoft.NET.CoreFramework.Debug.2.2_2.2.29301.2_x86__8wekyb3d8bbwe\System.Xml.ReaderWriter.dll". In the failing case these assemblies get loaded from the app layout directory, for example "C:\Users\lukewest\source\repos\UnitTestProject30\UnitTestProject30\bin\x86\Debug\AppX". And while System.Xml.ReaderWriter.dll exists in this directory, it's version is 1.0.24212.1. In the working scenario it's 4.6.29301.02. Here's the full call stack of the exception, I have a dmp available on request:
|
There's two possible workarounds, either:
|
To help narrow down the regression I tried using each of the two preview releases that came between 2.1.2 and 2.2.1, but they both failed with other errors: 2.2.0-preview-20201126-03: Build failed during GenerateResource task: error MSB3816: Loading assembly "C:\Users\lukewest.nuget\packages\mstest.testadapter\2.2.0-preview-20201126-03\build_common\Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.dll" failed. System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.VisualStudio.TestPlatform.ObjectModel, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified. 2.2.0-preview-20210115-03: Discovery failed: [MSTest][Discovery][entrypoint\UnitTestProject8.exe] MSTestAdapter failed to discover tests in class 'UnitTestProject8.UnitTest1' of assembly 'entrypoint\UnitTestProject8.exe' because Could not load type 'Microsoft.VisualStudio.TestPlatform.ObjectModel.ManagedNameUtilities.ManagedNameHelper' from assembly 'Microsoft.VisualStudio.TestPlatform.ObjectModel, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.. |
I found that this change that updated PlatformServices.Universal from using Microsoft.Internal.TestPlatform.ObjectModel v14.0.0 to Microsoft.TestPlatform.ObjectModel v16.9.0-preview-20201021-10 is what caused this issue. If I sync to the 2.1.2 build label and make just that change I repro this issue. |
Hi @MSLukeWest, I am slowly taking over MSTest. Could you confirm this is still an issue for you? Given the delay, I am wondering if the version is still a matter/supported. |
@Evangelink - While this issue can still be reproduced, it's not very impactful because most users don't need to run tests using projects with TargetPlatformMinVersion < RS3 (10.0.16299.0). |
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 #1274 (comment)). 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. |
After discussion with management we agreed on doing nothing as the issue is quite old and the number of impacted users is quite low. |
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
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
The text was updated successfully, but these errors were encountered: