-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Description
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 our Directory.Packages.props file:
<PackageVersion Include="Microsoft.IO.Redist" Version="6.0.1" />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.
- The exe.config generates proper binding redirects for the DLL
- The build does not deploy the DLL
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
- Clone github.com/dotnet/roslyn
- Reset to commit de10517376b251c28365aae6d27a8e7bb1352598
- Run
msbuild .\src\Workspaces\Core\MSBuild.BuildHost\Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost.csproj /v:m /m - Open
artifacts\bin\Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost\Debug\net472
Observe that the .exe.config file has the following binding redirect
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Microsoft.IO.Redist" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-6.0.0.1" newVersion="6.0.0.1" />
</dependentAssembly>
</assemblyBinding>Also observe that Microsoft.IO.Redist is not deployed.
Further technical details
This can be fixed by putting an explicit reference into the exe.
<PackageReference Include="Microsoft.IO.Redist" Condition="'$(TargetFrameworkIdentifier)' != '.NETCoreApp'" />