VSTest@3 fails with FileNotFoundException: Could not load file or assembly ‘System.Collections.Immutable, Version=8.0.0.0

This was a headscratcher which neither AI or Google knew about or could fix for me.

At work we have a large monolith with a combination of net48, netstandard and net8 projects. I’m upgrading the net8 ones to net10, as net8 is nearing its EOL.

When I upgraded the first of our test projects to net10, I started getting the above error in our CI pipeline.

First pro tip: if you can, reproduce the issue at the command line with vstest.console.exe, rather than trying to fix it by pushing changes and waiting for your CI build server to fail. This will speed up your feedback loop by about 100x.

Eventually I figured out that the issue:

One of our net8 test helper projects is called MyCompany.Core.Common.Tests, so it was accidentally being included via testAssemblyVer2: | **\MyCompany.*tests.dll. This helper project referenced Microsoft.NET.Test.Sdk but actually contained no tests.

Once I excluded that dll the issue went away. Again, it was all working fine when everything was net8 but only broke when one of our test assemblies was upgraded to net10.

              testAssemblyVer2: |
                **\MyCompany.*tests.dll
                !**\MyCompany.Core.Common.Tests.dll
This is the first time I’ve blogged in months, as so many of the challenges we face day to day as developers are made easier with 2026’s AI tools.
My current tool of choice is GitHub CoPilot in VS Code, using Claude Opus 4.7 which is the current state of art. It will be funny to look back on this post in a few years.

Leave a comment