dotnet / dotnet/msbuild

ClickOnce publish is missing files if multiple Content entries are set from a Task

Open
#5,199 0 comments 0 reactions 0 assignees View on GitHub
triaged
Dominant language
C#
Stars
5.5k
Forks
1.5k
Avg merge
1d 8h
Merged PRs (30d)
141

Description

### Steps to reproduce
Here is the test project I built to demonstrate the issue.
[MSBuildFileCopyIssue.zip](https://github.com/microsoft/msbuild/files/4383215/MSBuildFileCopyIssue.zip)

I was refining the include set for CEF# to make it as minimal as possible when I encountered this.

The changes to the project were minimal (and are attached) from the baseline project:
* I added a top level property group to the project to move the default configuration and platform if unspecified.
* I set the CefSharpAnyCpuSupport to true (project remained AnyCPU).
* Added a BrokenVersion property that will switch between the two tasks, one of which works, one that doesn't.
* Moved the Cef deploy to another folder so they aren't included in the deploy to ..\CEF_$(Configuration) using CefSharpTargetDir so it isn't automatically including everything.

Then I added the following tasks:
* Broken Task:
```






%(RecursiveDir)%(FileName)%(Extension)
PreserveNewest
Included
false




%(RecursiveDir)%(FileName)%(Extension)
PreserveNewest
Included
false




%(RecursiveDir)%(FileName)%(Extension)
PreserveNewest
Included
false




%(RecursiveDir)%(FileName)%(Extension)
PreserveNewest
Included
false




%(RecursiveDir)%(FileName)%(Extension)
PreserveNewest
Included
false




%(RecursiveDir)%(FileName)%(Extension)
PreserveNewest
Included
false



```

* Working Task:
![image](https://user-images.githubusercontent.com/1832056/77583232-19414580-6eb7-11ea-9831-7f95983b6c96.png)

When I publish via Visual Studio, not all files are published. Running a diagnostic build is showing that the link looks incorrect for all entries after the first in the Task.
1> Content=
1> ..\packages\cef.redist.x64.79.1.36\CEF\locales\en-GB.pak
1> CopyToOutputDirectory=PreserveNewest
1> Link=icudtl.dat
1> PublishState=Included
1> Visible=false

1>Added Item(s):
1> Content=
1> ..\packages\cef.redist.x64.79.1.36\CEF\chrome_elf.dll
1> CopyToOutputDirectory=PreserveNewest
1> Link=icudtl.dat
1> PublishState=Included
1> Visible=false
1> ..\packages\cef.redist.x64.79.1.36\CEF\d3dcompiler_47.dll
1> CopyToOutputDirectory=PreserveNewest
1> Link=icudtl.dat
1> PublishState=Included
1> Visible=false

Binaries directory content:
![image](https://user-images.githubusercontent.com/1832056/77581126-87840900-6eb3-11ea-8763-83426d36a915.png)

Publish directory content:
![image](https://user-images.githubusercontent.com/1832056/77581180-9b2f6f80-6eb3-11ea-912e-be011f2e9e9d.png)

Command line
Publish from Visual Studio

### Expected behavior
The same as when BrokenVersion is set to false--the full set of files from bin\ published to the Application Files.

### Actual behavior
The published Application files are missing a substantial amount of content.

OS info:
![image](https://user-images.githubusercontent.com/1832056/77581305-e21d6500-6eb3-11ea-888e-7d57a6745d65.png)

If applicable, version of the tool that invokes MSBuild (Visual Studio, dotnet CLI, etc):
![image](https://user-images.githubusercontent.com/1832056/77581305-e21d6500-6eb3-11ea-888e-7d57a6745d65.png)

Thank you,
Brent Scriver

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.