I have a file renaming issue that has cost me several hours wondering what was going on. Please don't mark me down for a repeat file naming question because I have spent a lot of time searching for this exact issue but the answers I found relate to missing files or file is in use or hidden files, etc. I have none of these issues. The screen grabs are from a new VS 2022 project in a new default folder. My explorer has all system and hidden files in view. The example below has an external folder named ‘Shared Classes’ containing a general purpose class named ‘Class1.vb’. I want to share this class between projects by linking the class1.vb file in each project. I have added nothing to the example project code and the example shared class is an empty class.

I want the shared file to go into a Visual Studio folder so I create a folder in VS IDE called ‘My Shared”. In the screen grab below I can see the folder is created in VS and inside the project folder on the hard drive.

I am now going to add the shared class as a link and I want it inside the ‘My Shared’ folder in the VS IDE. So I select the folder in the VS IDE and add my shared class as a link as shown below.

And the class appears inside the VS IDE folder as expected.
I now want to rename the VS folder to a more useful name so I rename the folder in the VS IDE to General Purpose Classes and the folder on the hard drive is automatically renamed by VS as expected; although the VS folder on the hard drive is actually empty and there is no link inside.

I then work on the code as usual and everything looks fine and works fine. I save and close VS when I've finished coding.

BUT...When I reopen the program my folder is no longer renamed in the VS IDE folders. The folder has gone back to being called “My Shared” in Visual Studio but in the application folder on the hard drive the empty shared folder still has the renamed folder name "General Purpose Classes". Everything still works in the program with this odd arrangement just as it did before. No errors or warnings, just the odd file naming.

I tried a few different scenarios and the renaming only fails if the shared folder contains links. The renaming even fails if the linked class is in the actual folder created inside the application folders by VS. If renaming a folder containing links somehow affects the links and is just a dumb thing for me to do then why doesn't VS warn me? Why pretend it's happened and confuse the hell out of me when I next open the program to find none of the folders I previously renamed have actually been renamed? It does the same thing in VS 2019 BTW. Thanks for your patience.
