Skip to content

dotnet format fails for WPF related project due to implicit Debug configuration use #52403

Open

Description

@nietras

Describe the bug

In CI we usually only build Release configurations. However, due to recent (unknown specific) changes, we are consistently faced with errors when running dotnet format since this implicitly depends on Debug dll output instead of being configurable. As a build can take some time, we are now forced to do Debug build as well as Release build to be able to run dotnet format. In addition, dotnet format will not actually be run on Release build as we would like but Debug.

To Reproduce

Download zip file as attached. Details can be seen from contents in zip file. .NET 10.0.101 etc.

WpfFormatRepro.zip

Run repro.ps1 or

rmdir .\build\
dotnet build -c Release
dotnet.exe format --verify-no-changes -v diagnostic --no-restore

This will fail with:

Msbuild failed when processing the file 'C:\git\WpfFormatRepro\src\WpfFormatRepro.All\WpfFormatRepro.All.csproj' 
with message: Unknown build error, 'Could not find a part of the path 
'C:\git\WpfFormatRepro\build\WpfFormatRepro.Theme_AnyCPU_Debug_net10.0-windows\WpfFormatRepro.Theme.dll'. 
Line 12 Position 10.'

OR rather if running format again:

Msbuild failed when processing the file 'C:\git\WpfFormatRepro\src\WpfFormatRepro.All\WpfFormatRepro.All.csproj' 
with message: The tag 'SwitchToggleButton' does not exist in XML namespace 
'clr-namespace:WpfFormatRepro.Theme.Controls;assembly=WpfFormatRepro.Theme'. Line 12 Position 10.

Activity

  1. added
    untriaged
    on Jan 12, 2026
  2. LarsPellarin commented on Jan 12, 2026

    @LarsPellarin

    i can reproduce that with the zipped solution provided above

  3. added this to the 11.0.1xx milestone on Feb 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area-Formatuntriaged

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions