dotnet / dotnet/project-system

Dragging file between folders which match wildcards for different Build Action items results in file being included in both

Open
#1,048 4 comments 0 reactions 0 assignees View on GitHub
Area-External-CPS Triage-Approved
Dominant language
C#
Stars
1k
Forks
415
PR merge metrics
No merged PRs in 30d

Description

- Create a new Console App (.NET Core) project
- Add the following to the `.csproj` file:

```xml



```

- Create a `wwwroot` folder in the project folder
- Create `TextFile1.txt` in wwwroot folder
- Create `TextFile2.txt` in project root folder
- Alternatively, open the following repro project instead of the provious steps: [FolderBuildActionRepro.zip](https://github.com/dotnet/roslyn-project-system/files/675184/FolderBuildActionRepro.zip)
- In Solution Explorer, drag `TextFile2.txt` to the `wwwroot` folder
- Save project file and view it

EXPECTED: Move operation should have included the file in the `None` item and removed it from the `Content` item, ie:

```xml






```

ACTUAL: The file is included in the `None` item but not removed from `Content`. So it will be in both items. Further project modifications can result in more weirdness because of this (for example, moving the file back to the root will include it in `Content` at the root and leave a `None` include for the file where it doesn't exist anymore).

```xml



```

NOTE: Changing the Build Action of `TextFile1.txt` from `Content` to `None` does correctly remove the file from the `Content` item and include it in the `None` item.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.