dotnet / dotnet/project-system

Copy-pasting files matching globbing patterns produces spurious results

Open
#5,661 4 comments 0 reactions 0 assignees View on GitHub
Area-External-CPS Feature-Project-File-Simplification Needs-CPS-work Triage-Approved
Dominant language
C#
Stars
1k
Forks
415
PR merge metrics
No merged PRs in 30d

Description

**Visual Studio Version**: 16.3.10

**Summary**: Possible Brock-Ackerman Anomaly in globbing / copy-pasting files matching globbed patterns

**Steps to Reproduce**:

1. Start with a csproj SDK file format with the following `ItemGroup`:
```xml


Always


App.config
Always


```

2. In the Visual Studio Solution Explorer, click on `App.config`, press control+C, control+V (doing copy-paste) results in a new file, named `App - Copy.config`.
3. Re-name that file App.Production.config

**Expected Behavior**:
1. No exception dialog should occur.
2. csproj file should not change (or should revert the "App - Copy.config`" temporary entry, because the re-named file should fall under the file-globbing pattern.

**Actual Behavior**:
1. Exception dialog occurs. ![image](https://user-images.githubusercontent.com/447485/69551043-0b5fd000-0f6a-11ea-9462-5b4b30ff3c29.png)
2. The csproj generates spurious entries:
```xml



```

Further, creating an `App.Beta.config` on top of `App.config` and `App.Production.config` produces even more spruious behavior that is truly unexpected. Copying and renaming `App.config` to `App.Beta.Config` generates a spurious `App - Copy.Production.config`!

**User Impact**:
Lots of time wasted fiddling csproj files directly.

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.