-
Notifications
You must be signed in to change notification settings - Fork 324
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
Multiple versions of the same extension found #3475
Comments
I have the same problem:
Environment: It all runs well on .NET 5.0+ |
I just try to create a demo solution of test projects. After some tries I found it's successful when there's only 1 project, but when I add another project ( with different MSTest package version that higher than old one's ) , then the error |
Is this going to get fixed? |
Time to reinvestigate! 🔎 |
✅ Successfully linked to Azure Boards work item(s): |
@Evangelink I am putting this on my board, but I think you told me that you already investigated this in the past. Let's get in touch, maybe it could also help mstest v2 v3 run side by side. |
I can repro seeing the warning, but not having tests fail. Vstest.console inspects all extensions from all projects and more places, and there can be conflict, and will be conflict when you use multiple versions of a test framework. This behavior (loading extensions from projects) is useful to add extension to vstest.console that are shipped in TestAdapter.dll, but in hindsight should not have been done. But the case that @jiangyz7cc saw is curious, because I am not able to replicate the warning actually causing issues, maybe I am doing something wrong, and someone has a repro. |
I get similar output to the initial issuer.
|
And, I'm unable to access the Azure Board reference (https://devdiv.visualstudio.com/0bdbc590-a062-4c3f-b0f6-9383f67865ee/_workitems/edit/2036316). Is that where this issue is being tracked? |
The azdo link is just so it appears on my internal work board. That output looks promising, so this is .net framework project, in a solution that has mix of versions of mstest? I see it fails in deployment, do you use |
From what I see this seems to repro only on .NET Framework dlls, when you run them under 1 instance of vstest.console, that is either by: running in VS, running under dotnet test + dll (but not csproj or dll), running under vstest.console (it only allows passing dll). This is caused by using a shared host, which is a "historical" performance optimization where the dlls will run in the same testhost.exe. This mode is enabled only for .NET Framework dlls, that don't enable process level parallelization, or that don't disable AppDomains. At the moment you can force the run to be in non-shared mode by setting:
Or using the equivalent runsettings, that specify at least one of these options. The maxcpucount can be anything that forces process-level parallelization, so any value that is 0, or more, but is NOT 1.
I am thinking of putting this Shared mode under a runsetting and feature flag, and disabling it by default. Because it is undocumented and confusing. |
Thanks for reply. I almost forgot the problem. But still remind this case seems occurs when I use a new NET version of MSTest project refers an old NET framework project or mixed with NET Standard one. It's like the shared host case, because the VS can not distinguish which version of Test frame (one) to use, then I update all projects to the new NET, I don't know how to re-make this happen now. |
@nohwnd saw your reply, with switch settings to force non-shared mode. Interestingly enough, the problem I'm seeing (having undiscovered tests in NET Framework targeted projects) seems to NOT affect NET Framework 4.8, while it does affect NET Framework 4.5.2. Here's my working list of relevant library dependencies for MSTest projects, if it helps: |
The options would go to runsettings. https://learn.microsoft.com/en-us/visualstudio/test/configure-unit-tests-by-using-a-dot-runsettings-file?view=vs-2022
This is interesting, I saw multiple ways to have tests broken, so you are maybe facing a different issue. |
Description
Warning is logged to the screen but not further information that would help diagnose the issue is provided. Nothing is written to log.
Steps to reproduce
Not sure, cannot diagnose it.
Expected behavior
I get versions and paths from where the extensions were loaded. Or I get that information in diag log so I can fix my test project.
Actual behavior
I get warning that is unhelpful.
Diagnostic logs
Nothing about this is written there.
Environment
AB#2036316
The text was updated successfully, but these errors were encountered: