dotnet / dotnet/project-system

Renaming a file to a .cs file causes extra items in the project file

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

Description

From @NickCraver on twitter: https://twitter.com/Nick_Craver/status/1150201135095066624

Repro:

1. Right click, add a class
2. File.Test as the name, enter
3. Because of the . in there, .cs wasn't appending, so F2 on file and change to File.Test.cs
4. This is in the .csproj:
![image](https://user-images.githubusercontent.com/754264/61178104-1eac7780-a629-11e9-8833-3276497d900d.png)

This is probably just None globbing (#4534) but maybe there is a small fix to be made in CPS to specifically improve the rename scenario.

Contributor guide

Open the contributing guide

Research direction

Reproduce the rename sequence in Visual Studio: add a class named File.Test, then rename it to File.Test.cs and inspect the resulting .csproj. Read the related None globbing issue #4534 and the CPS behavior around the rename. Done means the project file no longer gains the extra items shown in the report.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
build-system
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.