[Regression] MarkupCompilePass1 depends on System.Collections.Immutable 7.0.0.0 after VS dependency upgrade to 8.0.0.0
- Dominant language
- C#
- Stars
- 7.7k
- Forks
- 1.3k
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 61
Description
### Description
The System.Collections.Immutable package version was [recently upgraded from 7.0.0.0 to 8.0.0.0 in VS](https://devdiv.visualstudio.com/DevDiv/_git/VS/commit/7aa2cf2b548e5641a5b1b9f3616ffd1f991accfa?refName=refs%2Fheads%2Fmain&_a=compare&path=%2Fsrc%2FConfigData%2FPackages%2FMicrosoft.VisualStudio.MinShell%2Fcorefx.props). The [MarkupCompilePass1](https://github.com/dotnet/wpf/blob/ffcbbd60e24db27d67a6e75e4954588b007acb11/src/Microsoft.DotNet.Wpf/src/PresentationBuildTasks/Microsoft/Build/Tasks/Windows/MarkupCompilePass1.cs#L47) task is failing for one specific project ([WPFRuntimeTests.csproj](https://dev.azure.com/devdiv/DevDiv/_git/VS?path=/src/eft/mdf/Test/WPFDataBindingTests/Runtime/WPFRuntimeTests.csproj&_a=contents&version=GBmain)) with the following error:
error MC1000: Unknown build error, 'Could not load file or assembly 'System.Collections.Immutable, Version=7.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)'
[Here is an example of a build hitting this error](https://dev.azure.com/devdiv/DevDiv/_build/results?buildId=8852564&view=results). For context, this build pipeline installs a CI build for VS main to a clean agent machine. It then uses the new VS install to build the VS repo. The intention is to test the latest build tools in main.
Other projects which use this task are finding the 8.0.0.0 version of the binary. The explicit dependency in the task is also pointing to 8.0.0.0.

It is unclear why this project is looking for 7.0.0.0. Any assistance you may be able to provide with this investigation would be helpful.
### Reproduction Steps
Build [WPFRuntimeTests.csproj](https://dev.azure.com/devdiv/DevDiv/_git/VS?path=/src/eft/mdf/Test/WPFDataBindingTests/Runtime/WPFRuntimeTests.csproj&_a=contents&version=GBmain) with the latest version of main (this can be done on DevBox if you have access to one).
Create or log in to a dev box.
Open Visual Studio Installer
Update VS Main to latest version
Build WPFRuntimeTests.csproj
### Expected behavior
The MarkupCompilePass1 task should know to look for version 8.0.0.0 of System.Collections.Immutable.
### Actual behavior
The MarkupCompilePass1 task ignores PackageVersion and looks for version 7.0.0.0 of System.Collections.Immutable.
### Regression?
This task was working for WPFRuntimeTests.csproj before the VS PackageVersion dependency was upgraded to 8.0.0.0.
### Known Workarounds
Rollback the VS install prior to dependency upgrade.
### Impact
This is impacting all DevBox users. We are unable to build new DevBox images due to the failing build.
### Configuration
.NET 8
Windows 11
x64
### Other information
_No response_
Contributor guide
Assessment
This issue has not been assessed yet.