How to rename a project in Rider dotnet core solution
Asked Answered
L

1

10

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.

Lorri answered 11/12, 2017 at 22:47 Comment(0)
F
16

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
Folia answered 12/12, 2017 at 8:5 Comment(1)
Exactly all those things have to be done manually at the moment :) (well not all, but most)Narda

© 2022 - 2024 — McMap. All rights reserved.