Central transitive pinning updates app.config but does not deploy dependencies
- Dominant language
- C#
- Stars
- 3.2k
- Forks
- 1.3k
- PR merge metrics
- PR metrics pending
Description
### Describe the bug
As part of responding to the [Microsoft.IO.Redist MSA][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][commit-initial] to our `Directory.Packages.props` file:
```xml
```
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.
1. The exe.config generates proper binding redirects for the DLL
2. 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
1. Clone github.com/dotnet/roslyn
2. Reset to commit de10517376b251c28365aae6d27a8e7bb1352598
3. Run `msbuild .\src\Workspaces\Core\MSBuild.BuildHost\Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost.csproj /v:m /m`
4. Open `artifacts\bin\Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost\Debug\net472`
Observe that the .exe.config file has the following binding redirect
```xml
```
Also observe that Microsoft.IO.Redist is not deployed.
### Further technical details
This can be fixed by putting an explicit reference into the exe.
```xml
```
[msa]: https://github.com/dotnet/announcements/issues/313
[commit-initial]: https://github.com/dotnet/roslyn/pull/74653/commits/de10517376b251c28365aae6d27a8e7bb1352598
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.