dotnet format fails for WPF related project due to implicit Debug configuration use
- Dominant language
- C#
- Stars
- 3.2k
- Forks
- 1.3k
- PR merge metrics
- PR metrics pending
Description
### 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](https://github.com/user-attachments/files/24563298/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.
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.