Closed
Description
The _wpftmp
build inside a normal project is built with a global property set: $(_WpfTempProjectNuGetFilePathNoExt)
. It also now runs ResolveProjectReferences
by default. This combines to cause overbuild of the referenced projects, because MSBuild treats projects as distinct when they have different global properties.
This can be observed in build output:
❯ dotnet build --no-restore -bl
Microsoft (R) Build Engine version 17.0.0-preview-21477-04+3a1e456fe for .NET
Copyright (C) Microsoft Corporation. All rights reserved.
C:\Program Files\dotnet\sdk\6.0.100-rc.2.21478.25\MSBuild.dll -bl -consoleloggerparameters:Summary -distributedlogger:Microsoft.DotNet.Tools.MSBuild.MSBuildLogger,C:\Program Files\dotnet\sdk\6.0.100-rc.2.21478.25\dotnet.dll*Microsoft.DotNet.Tools.MSBuild.MSBuildForwardingLogger,C:\Program Files\dotnet\sdk\6.0.100-rc.2.21478.25\dotnet.dll -maxcpucount -verbosity:m .\wpf_incremental.sln
You are using a preview version of .NET. See: https://aka.ms/dotnet-core-preview
You are using a preview version of .NET. See: https://aka.ms/dotnet-core-preview
Library -> S:\play\wpf_incremental\Library\bin\Debug\net5.0\Library.dll
Library -> S:\play\wpf_incremental\Library\bin\Debug\net5.0\Library.dll
WpfApp -> S:\play\wpf_incremental\WpfApp\bin\Debug\net5.0-windows\WpfApp.dll
Note the doubled Library -> S:\play\wpf_incremental\Library\bin\Debug\net5.0\Library.dll
: that project is building twice.
The global property for the _wpftmp
project is set here:
Timeline:
- Workaround for WPF temp project not importing NuGet props/targets files arcade#1581 introduced
$(_WpfTempProjectNuGetFilePathNoExt)
to .NET's Arcade SDK. - Support PackageReferences in WPF projects #3585 introduced
$(IncludePackageReferencesDuringMarkupCompilation)
(defaulted tofalse
). This introduced this race condition. - [release/5.0] Support Source Generators in WPF projects #3846 backported it to .NET 5.0 SDKs. This included ee91876 that unconditionally set
_WpfTempProjectNuGetFilePathNoExt
to empty. - Opt into IncludePackageReferencesDuringMarkupCompilation sdk#15465 turned
$(IncludePackageReferencesDuringMarkupCompilation)
on by default in the SDK. - Revert 'Opt into IncludePackageReferencesDuringMarkupCompilation' sdk#15695 turned it off again, so this isn't noticeable in the default configurations under .NET SDK 5.0.yxx .
- Make source generator and package reference support opt-out (on by default) #4089 flipped the default in WPF.
Metadata
Metadata
Assignees
Labels
No labels