dotnet / dotnet/msbuild

Copy task's "skip copies if source and destination are the same" optimization fires when file doesn't exist

Open
#9,148 3 comments 1 reaction 0 assignees View on GitHub
Area: Tasks Feature: Warning Waves Priority:3 triaged
Dominant language
C#
Stars
5.5k
Forks
1.5k
Avg merge
1d 8h
Merged PRs (30d)
141

Description

```xml



```

```sh-session
❯ msbuild -v:d
MSBuild version 17.8.0-preview-23418-03+0125fc9fb for .NET Framework
Build started 8/21/2023 3:21:46 PM.
Process = "C:\Program Files\Microsoft Visual Studio\2022\Preview\MSBuild\Current\Bin\amd64\MSBuild.exe"
MSBuild executable path = "C:\Program Files\Microsoft Visual Studio\2022\Preview\MSBuild\Current\Bin\amd64\MSBuild.exe"
Command line arguments = ""C:\Program Files\Microsoft Visual Studio\2022\Preview\\MSBuild\Current\Bin\amd64\MSBuild.exe
" -v:d"
Current directory = "S:\play\alkejtlk"
MSBuild version = "17.8.0-preview-23418-03+0125fc9fb"
Some command line switches were read from the auto-response file "C:\Program Files\Microsoft Visual Studio\2022\Preview
\MSBuild\Current\Bin\amd64\MSBuild.rsp". To disable this file, use the "-noAutoResponse" switch.

Assembly loaded during Evaluation: System.Collections.Immutable, Version=7.0.0.0, Culture=neutral, PublicKeyToken=b03f5
f7f11d50a3a (location: C:\Program Files\Microsoft Visual Studio\2022\Preview\MSBuild\Current\Bin\System.Collections.Imm
utable.dll, MVID: 5f9ff90f-0d16-4469-a104-76829d3705e2, AppDomain: [Default])
Project "S:\play\alkejtlk\foo.proj" on node 1 (default targets).
Target "CopyMissingFileOnItself" in project "S:\play\alkejtlk\foo.proj" (entry point):
Using "Copy" task from assembly "Microsoft.Build.Tasks.Core, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f
11d50a3a".
Task "Copy"
Done executing task "Copy".
Done building target "CopyMissingFileOnItself" in project "foo.proj".
Done Building Project "S:\play\alkejtlk\foo.proj" (default targets).

Build succeeded.
0 Warning(s)
0 Error(s)

Time Elapsed 00:00:00.03
```

. . . but that file doesn't exist. Feels like we should error in that case.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.