Class Name Not Updating After Renaming and Copying/Pasting File
See original GitHub issueVersion Used: Visual Studio 2019 16.8 Preview 1
Steps to Reproduce:
- Create a new .NET Core Class Library project.
- Click Class1.cs file in Solution Explorer and rename to Class2.cs. Should get a prompt to say renaming file. Click Yes and the
class Class1
gets renamed toclass Class2
in code. - Copy and paste Class2.cs file (I did at same level in solution). Should have the Class2 - Copy. cs at this point.
- Double click Class2.cs file to see code. The Class name in code is still
class Class1
.
Expected Behavior:
I believe Class2 - Copy.cs should also be class Class2
since I made a copy of it after changing the name.
Actual Behavior: The copied file contains the Class name before the original file was renamed, copied and pasted.
Hope this helps.
Issue Analytics
- State:
- Created 3 years ago
- Comments:12 (9 by maintainers)
Top Results From Across the Web
Class Name Not Updating After Renaming and Copying ...
Click Class1.cs file in Solution Explorer and rename to Class2.cs. Should get a prompt to say renaming file. Click Yes and the class...
Read more >After copying a class and renaming the class-file ...
Now Visual Studio renames the classname (refactor) in both new new copy in folder (zz) and the copied source in folder (xx). This...
Read more >visual studio - Renaming a class file no longer prompts to ...
1 Answer. Try changing class name, not file name. As 1 file can holds multiple classes. (Don't know if this is true for...
Read more >Copy and Paste after changing file names
Hello, I am having some problems with copying and pasting files. I was trying to copy a file and then change the name...
Read more >The nightmare that is renaming a class and its folder - LAVA
Renaming a class from LabVIEW, no problem, F2 works wonders. But now it's contained on disk in a folder that most likely has...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Perfect, I have a repro now. Thanks!
@ryzngard does this help?