Project-system: Renaming a project should rename the containing folder

Created on 13 Aug 2016  Â·  5Comments  Â·  Source: dotnet/project-system

I often find that after renaming projects that I forgot to rename the containing folder. For example, let's say I have a solution like this:

│   MySolution.sln
│
└───ClassLibrary1
        ClassLibrary1.csproj

Now let's say I rename ClassLibrary1.csproj to Awesome.Feature.csproj. The outcome looks like this:

Actual

│   MySolution.sln
│
└───ClassLibrary1
        Awesome.Feature.csproj

Expected

│   MySolution.sln
│
└───Awesome.Feature
        Awesome.Feature.csproj
Feature Request

Most helpful comment

:+1:
What about namespaces?
In the end I would like to have a replacement for this:
https://alexanderzeitler.com/articles/rename-visual-studio-project-namespaces-and-folders-automate-everything/

All 5 comments

Yes! Yes, a thousand times yes! This has been bugging me for ages.

:+1:
What about namespaces?
In the end I would like to have a replacement for this:
https://alexanderzeitler.com/articles/rename-visual-studio-project-namespaces-and-folders-automate-everything/

what @joakimskoog said. We have to essentially remove the project from the solution, rename the folder, and then re-add the project to complete the process. Then there's the risk of losing references altogether, and have to re-add them to all the projects that were referencing the project in question as well (although this doesn't seem as bad now as it has in the past). Still, it's a pain. Lots of considerations as described, with default namespaces and such. You are nearly guaranteed to rename _something_ within your project at least once during its lifetime. For me it always seems like it happens within the first week or so. These sorts of friction points deter considerations. This would be an awesome improvement. :+1:

+100

Closing because it's a duplicate of #111.

Was this page helpful?
0 / 5 - 0 ratings