You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Summary: There are times when you already have a class or report and you need a pretty similar file. So duplicating the already existing one and changing it is much faster, then recreating a new one from scratch. The problem is that VS doesn't offer a nice way to duplicate a file with a new given name. If you copy a file and paste it into the same folder, VS detect the file duplication and the pasted file will automatically gets a " - Copy" file name suffix. The problem is VS in this state unable to refactor the filename and it's class and constructor name. Which by convention all should be the same.
I would guess this is an expected behavior, since this is how Windows handles file duplication. So if you copy a file and paste it into the same folder - without any warning - the new file will get a " - Copy" suffix. You only get the file duplication prompt window if you copy files between folders, but not in the same folder.
it doesn't allow file duplication AND doesn't creates a new file automatically. So it doesn't creates a new file and leaves it in a "broken state" for further file name refactoring.
When you give it a new and valid file name, the file's class and it's constructor are properly named after the file.
User Impact:
My issue is that there is no way to duplicate a file in a clean manner in VS. You can rename the file's name (+designer name if it has one), but the actual file content (class, constructor) needs to be manually edited.
The text was updated successfully, but these errors were encountered:
jjmew
transferred this issue from dotnet/project-system
Oct 29, 2020
Visual Studio Version: 16.7.7
Summary: There are times when you already have a class or report and you need a pretty similar file. So duplicating the already existing one and changing it is much faster, then recreating a new one from scratch. The problem is that VS doesn't offer a nice way to duplicate a file with a new given name. If you copy a file and paste it into the same folder, VS detect the file duplication and the pasted file will automatically gets a " - Copy" file name suffix. The problem is VS in this state unable to refactor the filename and it's class and constructor name. Which by convention all should be the same.
I would guess this is an expected behavior, since this is how Windows handles file duplication. So if you copy a file and paste it into the same folder - without any warning - the new file will get a " - Copy" suffix. You only get the file duplication prompt window if you copy files between folders, but not in the same folder.
Steps to Reproduce:
https://giant.gfycat.com/LinearHopefulAlabamamapturtle.webm
Expected Behavior:
Here's how Intellij handles the same situation:
https://giant.gfycat.com/IgnorantDiscreteAustraliankestrel.webm
it doesn't allow file duplication AND doesn't creates a new file automatically. So it doesn't creates a new file and leaves it in a "broken state" for further file name refactoring.
When you give it a new and valid file name, the file's class and it's constructor are properly named after the file.
User Impact:
My issue is that there is no way to duplicate a file in a clean manner in VS. You can rename the file's name (+designer name if it has one), but the actual file content (class, constructor) needs to be manually edited.
The text was updated successfully, but these errors were encountered: