Skip to content
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

ValueTask defined in xunit.runner.visualstudio v3 causing conflict #431

Open
6bee opened this issue Dec 20, 2024 · 2 comments
Open

ValueTask defined in xunit.runner.visualstudio v3 causing conflict #431

6bee opened this issue Dec 20, 2024 · 2 comments

Comments

@6bee
Copy link

6bee commented Dec 20, 2024

Issue

Type conflict caused by ValueTask<> causes dynamic type resolution to fail.
The following two type definitions collide for tests executed on .NET Framework:

System.Threading.Tasks.ValueTask`1, System.Threading.Tasks.Extensions, Version=4.2.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51
System.Threading.Tasks.ValueTask`1, xunit.runner.visualstudio.testadapter, Version=3.0.0.0, Culture=neutral, PublicKeyToken=null

Potential Resolution

Would it be possible to used System.Threading.Tasks.Extensions package rather than defining your own ValueTask<>?

Background

aqua-core is a library that allows to serialize type information to be carried and re-created across application boundaries, different .net runtime and platform versions. Types defined in multiple locations (loaded into the default loading context) do contradict the concept and cannot be included in corresponding models. Hence, we're currently blocked from updating to xunit.runner.visualstudio.3.0.0.

@bradwilson
Copy link
Member

The reason you're seeing this is because the test adapter uses ILRepack so there is a private copy that's been repacked inside.

However, the more important question is: Why are you linking against xunit.runner.visualstudio.testadapter? Nobody should be doing that.

@6bee
Copy link
Author

6bee commented Dec 20, 2024

There is a package reference to xunit.runner.visualstudio for our unit test projects. No direct reference to xunit.runner.visualstudio.testadapter.
However, I suspect since we're using reflection to resolve types by full-name (not assembly-qualified-name), looking-up all loaded assemblies from AppDomain.CurrentDomain.GetAssemblies(), we end-up using System.Threading.Tasks.ValueTask<> from xunit.runner.visualstudio.testadapter assembly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants