Skip to content

9.0.102(?) regresses incremental build of .exe.config files, dropping binding redirects and breaking testing in VS #11362

@AArnott

Description

@AArnott

Describe the bug

Incremental build (in VS or with dotnet build at the CLI) blows away a good .exe.config file and replaces it with a near-copy of the app.config in the source directory, omitting all the msbuild-generated binding redirects.

This used to work fine... something recently broke it, and at times it seems to repro uniquely on 9.0.102 while 9.0.101 is fine. But this isn't consistently repeatable.

To Reproduce

git clone https://github.com/microsoft/VSSDK-Analyzers.git
cd VSSDK-Analyzers
git checkout 993b80f
./init.ps1
dotnet build test\Microsoft.VisualStudio.SDK.Analyzers.Tests
type bin\Microsoft.VisualStudio.SDK.Analyzers.Tests\Debug\net472\Microsoft.VisualStudio.SDK.Analyzers.Tests.exe.config

Notice how you get a large .exe.config file with many binding redirects.
Now repeat the build:

dotnet build test\Microsoft.VisualStudio.SDK.Analyzers.Tests
type bin\Microsoft.VisualStudio.SDK.Analyzers.Tests\Debug\net472\Microsoft.VisualStudio.SDK.Analyzers.Tests.exe.config

See how now you get a very small .exe.config file, which is nearly identical to the app.config in the project directory.

Sometimes this repro works, sometimes it doesn't. But what seems more consistent (at the moment at least) is building twice in a row within Visual Studio.

Further technical details

  • Include the output of dotnet --info
dotnet --info
.NET SDK:
 Version:           9.0.102
 Commit:            cb83cd4923
 Workload version:  9.0.100-manifests.693890c1
 MSBuild version:   17.12.18+ed8c6aec5

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.26100
 OS Platform: Windows
 RID:         win-x64
 Base Path:   C:\Program Files\dotnet\sdk\9.0.102\

.NET workloads installed:
 [wasm-tools-net6]
   Installation Source: VS 17.14.35724.70, VS 17.14.35723.260
   Manifest Version:    9.0.1/9.0.100
   Manifest Path:       C:\Program Files\dotnet\sdk-manifests\9.0.100\microsoft.net.workload.mono.toolchain.net6\9.0.1\WorkloadManifest.json
   Install Type:              Msi

 [wasm-tools-net7]
   Installation Source: VS 17.14.35724.70, VS 17.14.35723.260
   Manifest Version:    9.0.1/9.0.100
   Manifest Path:       C:\Program Files\dotnet\sdk-manifests\9.0.100\microsoft.net.workload.mono.toolchain.net7\9.0.1\WorkloadManifest.json
   Install Type:              Msi

 [wasm-tools-net8]
   Installation Source: VS 17.14.35724.70, VS 17.14.35723.260
   Manifest Version:    9.0.1/9.0.100
   Manifest Path:       C:\Program Files\dotnet\sdk-manifests\9.0.100\microsoft.net.workload.mono.toolchain.net8\9.0.1\WorkloadManifest.json
   Install Type:              Msi

 [wasm-tools]
   Installation Source: VS 17.14.35724.70, VS 17.14.35723.260
   Manifest Version:    9.0.1/9.0.100
   Manifest Path:       C:\Program Files\dotnet\sdk-manifests\9.0.100\microsoft.net.workload.mono.toolchain.current\9.0.1\WorkloadManifest.json
   Install Type:              Msi

 [aspire]
   Installation Source: VS 17.14.35724.70, VS 17.14.35723.260
   Manifest Version:    8.2.2/8.0.100
   Manifest Path:       C:\Program Files\dotnet\sdk-manifests\8.0.100\microsoft.net.sdk.aspire\8.2.2\WorkloadManifest.json
   Install Type:              Msi

Configured to use loose manifests when installing new manifests.

Host:
  Version:      9.0.1
  Architecture: x64
  Commit:       c8acea2262

.NET SDKs installed:
  6.0.428 [C:\Program Files\dotnet\sdk]
  8.0.308 [C:\Program Files\dotnet\sdk]
  8.0.405 [C:\Program Files\dotnet\sdk]
  9.0.102 [C:\Program Files\dotnet\sdk]
  9.0.200-preview.0.25057.12 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 6.0.36 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 8.0.11 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 8.0.12 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 9.0.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 9.0.1 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 6.0.36 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 7.0.20 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 8.0.7 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 8.0.11 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 8.0.12 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 9.0.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 9.0.1 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.WindowsDesktop.App 6.0.36 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 7.0.20 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 8.0.7 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 8.0.11 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 8.0.12 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 9.0.0 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 9.0.1 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

Other architectures found:
  x86   [C:\Program Files (x86)\dotnet]
    registered at [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\x86\InstallLocation]

Environment variables:
  Not set

global.json file:
  Q:\source\VSSDK-Analyzers\global.json

Learn more:
  https://aka.ms/dotnet/info

Download .NET:
  https://aka.ms/dotnet/download
  • The IDE (VS / VS Code/ VS4Mac) you're running on, and its version
    Visual Studio 17.14 (35723.260.main)

Metadata

Metadata

Assignees

Labels

Type

No fields configured for Bug.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions