Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio Code - error after rename file from lower case to upper case

After I rename my file name (lower case to upper case) in VS Code, example card.cs to Card.cs, I get the error: The type of namespace could not be found are you missing a using directive or an assembly

How should I fix this issue?

Secondly, should I rename it at VS code locally, then push to my Git or should I rename it at Git and then pull it from Git?

like image 604
Steve Avatar asked Mar 06 '26 00:03

Steve


2 Answers

Somehow after restart my VS Code, the error no more already. Solution is to rename in VS Code using 'rename' function and if file name is different I rename it using Git command

like image 76
Steve Avatar answered Mar 07 '26 12:03

Steve


It also happens to me when changing uppercase to lowercase or vice versa. If it gets stuck like this and VS Code still requires the old name, it helps me to change the name to something else entirely and then rename it to what I want.

like image 37
Tom Trnka Avatar answered Mar 07 '26 14:03

Tom Trnka



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!