Closed anlau closed 4 years ago
Triage note: Investigate whether the fix in 16.5 (#5851) addresses this.
@drewnoakes this issue still repro. It seems that the bug is because FUTD is using the incorrect source file to compare with the destination file. The current implementation is using the intermediate file as the source file instead of App.config. The data is given by state.CopiedOutputFiles. I started checking BuildUpToDateCheck.State
@drewnoakes
The target GenerateSupportedRuntime adds the items AppConfigWithTargetPath.
Why the target GenerateSupportedRuntime needs to remove this item ? <AppConfigWithTargetPath Remove="@(AppConfigWithTargetPath)" />
It seems that design-time builds is not updating the intermediate file whenever App.config changes. This should happen before the target CollectUpToDateCheckBuiltDesignTime.
This seems like a question for the SDK folks @dsplaisted @nguerrera
@drewnoakes this change fixes this issue https://github.com/ocallesp/project-system/commit/d5c54fffe9c25294cde4e0eea689a40e4378912e
Visual Studio Version:
Version 16.4.5
Summary:
We recently migrated a .NET Framework WPF application to SDK-style projects and I encountered the following behavior.
Steps to Reproduce:
Create a new WPF project:
dotnet new wpf
(dotnet -v
is 3.1.101)Modify created
csproj
to targetnet452
(does not seem to matter, as long it is .NET Framework)Add an
app.config
file with minimal content (like anappSettings
section with one entry)Build twice, the second time should output "1 up-to-date"
Modify added
app.config
(ex. change existing entry key or value)Build
Expected Behavior:
Fast up-to-date check triggers a build.
Actual Behavior:
User Impact:
Not much; something which can be surprising or maybe annoying for developers (the build have to be forced by modifying something else).
When looking at the "Up to date checks" output, it seems an intermediate file is used as the source for the generated
.exe.config
:If
<GenerateSupportedRuntime>false</GenerateSupportedRuntime>
is added to the csproj, everything works as expected (source is nowC:\Users\Antoine\Desktop\MyWpfProject\App.config
).Adding the following
UpToDateCheckBuilt
to the csproj seems to work too.Thanks!