Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to rename a project in Rider dotnet core solution

I've got a test project in a tiny dotnet core solution based project, created in Jetbrains Rider, but it has the default name "UnitTestProject". (When I added it I thought "naming is hard - but renaming is easy!").

I've renamed the namespace in the tests, but can't work out how to rename the project itself in Rider.

  • f6 (which is usually rename) does nothing.
  • right-clicking on the project - the rename option is greyed out.

I assume I can just grep around in the .csproj and .sln and rename it by hand, but surely this should be easy in my shiny new IDE?

Rider 2017.2 (full subscription version).
Dotnet core version 2.03.
Ubuntu 16.04 if that matters.

like image 510
Andrew M Avatar asked Dec 11 '17 22:12

Andrew M


People also ask

How do I Rename a project in Solution?

Right click on the solution and click on Rename. Similarly, do it for the project as well.

How do I Rename a file in Csproj?

Right-click on the project name & click reload the project. Then rename the project name as highlighted below & save. It will automatically rename the . csproj file.


1 Answers

EDIT: As of September/October 2018, this feature has now been implemented in Rider versions >= 2018.3


For now there is no such feature in Rider, see RIDER-1224 issue in our issue tracker for more details.

Shortly, we are going to implement this soon, probably in 2018.1\2018.2. The reason why the feature was not implemented already: the feature is really complicated.

When you rename a project you have to

  • rename project folder and project file
  • fix all references on that project
  • fix all linked files stored in the project's folder
  • fix namespaces, assembly name
  • fix assembly name usages (xaml, etc)
  • look at all msbuild files (project file itself and related target files) which can contains old project name
  • don't forget about changes in VCS and undo operation
  • do something else
like image 174
xtmq Avatar answered Oct 13 '22 01:10

xtmq