Open jaredpar opened 1 month ago
I think what's happening here after some experimentation is that the ExcludeAssets="runtime"
on the MSBuild references is transtively applying to Microsoft.IO.Redist as well, so it's not being copied to the output directory. As soon as I remove that from my repro project the expected file is copied to the output directory.
Describe the bug
As part of responding to the Microsoft.IO.Redist MSA the Roslyn repo needed to move to version 6.0.1. This is an implicit transitive dependency on that package via our Microsoft.Build package references. To fix this we needed to move to an explicit reference.
Our repo utilizes
CentralPackageTransitivePinningEnabled
so to approach this issue we just added a new entry to ourDirectory.Packages.props
file:This fixes the GC issue but resulted in a number of test failures. After a lot of debugging we discovered that this ends up doing the following for our
net472
applications that transitively bring in Microsoft.IO.Redist.This means it effectively produces a non-functioning application. There is a binding redirect for a DLL that does not deploy and that results in runtime errors
To Reproduce
msbuild .\src\Workspaces\Core\MSBuild.BuildHost\Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost.csproj /v:m /m
artifacts\bin\Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost\Debug\net472
Observe that the .exe.config file has the following binding redirect
Also observe that Microsoft.IO.Redist is not deployed.
Further technical details
This can be fixed by putting an explicit reference into the exe.