{"id":22693488,"url":"https://github.com/modernronin/projectrenamer","last_synced_at":"2025-04-05T21:09:42.210Z","repository":{"id":46167258,"uuid":"292658739","full_name":"ModernRonin/ProjectRenamer","owner":"ModernRonin","description":"Conveniently rename your csproj files ","archived":false,"fork":false,"pushed_at":"2022-10-13T09:53:05.000Z","size":211,"stargazers_count":169,"open_issues_count":10,"forks_count":14,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-29T20:07:30.323Z","etag":null,"topics":["csharp","csproj","csproj-tooling","dotnet","paket","rename","renameproject","utility"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ModernRonin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-09-03T19:14:28.000Z","updated_at":"2025-02-26T13:08:04.000Z","dependencies_parsed_at":"2023-01-19T21:56:14.368Z","dependency_job_id":null,"html_url":"https://github.com/ModernRonin/ProjectRenamer","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ModernRonin%2FProjectRenamer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ModernRonin%2FProjectRenamer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ModernRonin%2FProjectRenamer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ModernRonin%2FProjectRenamer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ModernRonin","download_url":"https://codeload.github.com/ModernRonin/ProjectRenamer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247399879,"owners_count":20932880,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["csharp","csproj","csproj-tooling","dotnet","paket","rename","renameproject","utility"],"created_at":"2024-12-10T02:11:27.139Z","updated_at":"2025-04-05T21:09:42.191Z","avatar_url":"https://github.com/ModernRonin.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# renameproject\n![CI Status](https://github.com/ModernRonin/ProjectRenamer/actions/workflows/dotnet.yml/badge.svg)\n[![NuGet](https://img.shields.io/nuget/v/ModernRonin.ProjectRenamer.svg)](https://www.nuget.org/packages/ModernRonin.ProjectRenamer/)\n[![NuGet](https://img.shields.io/nuget/dt/ModernRonin.ProjectRenamer.svg)](https://www.nuget.org/packages/ModernRonin.ProjectRenamer)\n[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com) \n## Summary\nHow often have you felt the need to rename or move a C# (or [VB](#use-with-vb-projects)) project? If you have come here, then you know that the most important existing IDE for C#, Visual Studio,\ndoes not really support this scenario very well.\n\nThis tool takes care of this for you, provided your use-case follows a set of fairly common practices:\n* you use **git** as a repository and have `git`(the executable) on your PATH\n* your `csproj` files have the same name as the folder in which they reside together with accompanying source code\n* you don't have more than one solution file (`.sln`) in one directory\n* you have **dotnetcore 3.1** or above (**note: as we are approaching the release of net7, I will soon upgrade the tool to net6)\n* your solution does not contain nested solution folders - the tool currently has an issue with that and will fail; until I find the time to fix that, the \nworkaround is simply to move the nested solution folder to top-level via VS, run the tool, and then move the solution folder back;seeing as this is two \nsimple drag-and-drops that only change the solution file, I hope this is acceptable.\n\n\n## Get it\n*renameproject* is intended to be used as a global dotnet tool. \n(You could install it as a local tool, too, but given what it does this does not really make a lot of sense.)\n\nYou install it by executing:\n\n```shell\ndotnet tool install -g ModernRonin.ProjectRenamer\n```\n\n## Update it\nIf there is a new version out, you can update *renameproject* with\n\n```shell\ndotnet tool update --global ModernRonin.ProjectRenamer\n```\n\nWhen I publish a new version, I always post at [my blog](https://modernronin.github.io/) under the [renameproject tag](https://modernronin.github.io/tags/renameproject/), aside from updating this readme here.\n\n### Release History\n2.2.1:\n* bugfix: all Import Project directives with relative paths will be correctly adjusted now\n\n2.2.0:\n* feature: tool can be used on VB projects, too; thanks to [@fsbflavio](https://github.com/fsbflavio) for the PR!\n* bugfix: fixed a potential deadlock; thanks to [@fsbflavio](https://github.com/fsbflavio) for the PR!\n\n2.1.5:\n* bugfix: tool can be used on *nix platforms now without crashing; thanks to [@pranav-ninja](https://github.com/pranav-ninja) for the PR!\n\n2.1.4:\n* bugfix: fixed issue when paths contained whitespace; thanks to [@jakubmaguza](https://github.com/jakubmaguza) for the PR - the first contribution from anyone else :-)\n\n2.1.3:\n* bugfix: fixed a bug concerning nested solution folders; thanks to [@Mike-E-angelo](https://github.com/mike-e-angelo) for reporting the bug\n\n2.1.2:\n* bugfix: fixed another whitespace related scenario; thanks to [@sejohnson-at-griffis](https://github.com/sejohnson-at-griffis) for reporting the bug\n\n2.1.1:\n* bugfix: projects in paths containing whitespace no longer crash the dotnet commands; thanks to [@NicolasRiou](https://github.com/NicolasRiou) for reporting the bug\n\n2.1.0:\n* feature: you can move projects to different folders now instead of just renaming them\n* feature: you can specify a directory to exclude from project reference updates\n* feature: the detected VS solution folder is displayed in review\n* feature: the detected git version is displayed in review\n* bugfix: when called with unnamed arguments, old project name now is understood to come before new project name (before it was the wrong way round)\n* bugfix: VS solution folders containing spaces don't crash the tool anymore\n\n2.0.0: \n* breaking change: instead of asking the user interactively, behavior is now controlled via commandline switches\n\n1.0.1: \n* bugfix: if a project is not in a solution folder, the tools works now, too\n* bugfix: if a required tool like git cannot be found, give a proper error message\n\n1.0.0: initial release\n\n## Use it\nYou use it from the command line, in the directory of your solution:\n\n```shell\nrenameproject \u003coldProjectName\u003e \u003cnewProjectName\u003e\n```\n\nThe project names include neither path nor extension (.csproj). *renameproject* will find your project just by the name, no matter how deeply it might be hidden in your directory structure.\nIt must be linked into the solution, though.\n\n### Simple rename\nExample usage:\n```shell\nrenameproject ModernRonin.ProjectRenamer ModernRonin.RenameProject\n```\n\nWhat will happen:\n* the project file will be renamed\n* the folder of the project file will be renamed\n* renaming is done with `git mv` so it keeps your history intact\n* all `\u003cProjectReference\u003e` tags in other projects in your solution referencing the project will be adjusted\n* if you use [paket](https://github.com/fsprojects/Paket) **as a local dotnet tool** (see [Soft Limitations](#soft-limitations)), `paket install` will be run, unless you specified the flag `--no-paket`\n* all changes will be staged in git\n* if you specified a flag `--build`, a `dotnet build` will be run just to be totally safe that everything worked well, for very cautious/diligent people :-)\n* a commit of the form `Renamed \u003coldProjectName\u003e to \u003cnewProjectName\u003e` will be created automatically, unless you specified a flag `--no-commit`\n\nIf anything goes wrong, all changes will be discarded.\n\n### Move\nSince version 2.1.0, the tool also allows you to move projects. To do this, you prefix the new name with a relative folder. \n\nHere's an example:\n```shell\nrenameproject ModernRonin.ProjectRenamer src/ModernRonin.ProjectRenamer\n```\n\nIf you want to move a project from somewhere in a subfolder into the root of the solution, prefix the new name with `./`.\n\nFor example, to revert the change from the previous example you'd do:\n```shell\nrenameproject ModernRonin.ProjectRenamer ./ModernRonin.ProjectRenamer --project-extension=.vbproj\n```\n\n### Rename and Move combined\nYou can also move and rename in one operation like\n```shell\nrenameproject ModernRonin.ProjectRenamer src/ModernRonin.RenameProject\n```\n\n\u003eHowever, there is a **caveat**: git interprets this not as rename, but as delete and create and thus you will loose the history of your project file. Thus, I recommend to do such things in two passes.\n\n### Exclude Directory\nIn some situations, for example if your repository contains a separate solution with separate projects in a subdirectory, you want to exclude a directory completely from being looked at by the project reference update mechanism. In that case, you can specify that directory with the optional `--exclude` argument.\n\n### Use with VB projects\nSince version 2.2.0, you can rename Visual Basic projects now, too, thanks to a PR from [@fsbflavio](https://github.com/fsbflavio):\n\n```shell\nrenameproject ModernRonin.ProjectRenamer ModernRonin.RenameProject --project\n```\n\n### Help\nFor details about available arguments and flags/options and some example calls, you can also use \n```shell\nrenameproject help\n```\nto get help about the available flags.\n\n## Limitations\n*renameproject* has a few limitations. Some of them are *hard limitations*, meaning they are unlikely to go away, others are *soft limitations*, meaning they exist only because I simply have not gotten round to fix them yet. I  \ndo not really have a lot of free time to spend on this, but am **totally open to PRs (hint hint)**. \n\n### Hard Limitations\n* Your local repository copy must be clean. This is to ensure that in case we have to discard changes, we don't discard anything you wouldn't want discarded, by accident.\nIf *renameproject* detects uncommitted changes, added files or the like, it will abort its operation.\n* the tool won't adjust your namespaces - just use R# for this.\n* I have not tested this with old-style, pre-SDK `csproj` projects and I very likely never will\n\n### Soft Limitations\n* you cannot have more than one solution file or the solution file in another location than the current directory - could be turned into an optional command-line argument in the future\n* you cannot use this without git - the git-aspects could be made optional via a command-line flag in the future\n* you cannot use this with projects of other types than `csproj` or \"vbproj\"; you can try to use it with for example `fsproj`, but there has been no testing this of any kind\n* the detection of whether the local repo is clean might throw false positives in some cases\n* you cannot use wildcards, like `renameproject ModernRonin.CommonServices.* ModernRonin.Common.Services.* ` - this would be very handy for the wide-spread convention to have an accompanying ` *.Tests ` project\n* you need to manually update the tool with `dotnet tool update -g ModernRonin.ProjectRenamer` and you need to come here to check whether there is a new version (or check nuget)\n* if you use paket as a global tool instead of as a local tool, paket support will fail currently - you should really switch to using paket as a local tool, if you can. but on the other hand, in the future *renameproject* might just become smarter about this using a combination of checking whether there is `paket` in the `PATH` and the presence of `dotnet-tools.json` and whether it contains an entry for paket\n\n\n## License\nThe [license](./LICENSE) is [Creative Commons BY-SA 4.0](https://creativecommons.org/licenses/by-sa/4.0/). In essence this means you are free to use and distribute and change this tool however you see fit, as long as you provide a link to the license\nand share any customizations/changes you might perform under the same license. \n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmodernronin%2Fprojectrenamer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmodernronin%2Fprojectrenamer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmodernronin%2Fprojectrenamer/lists"}