<p>I have a vs.net project, and after some refactoring, have modified the name of the project.  How can I easily rename the underlying windows folder name to match this new project name under a TFS controlled project and solution?<br>
Note, I used to be able to do by fiddling with things in the background using SourceSafe ... </p>

[{'answer_id': 49154, 'author': 'Mr. Kraus', 'author_id': 5132, 'author_profile': 'https://Stackoverflow.com/users/5132', 'pm_score': 1, 'selected': False, 'text': '<p>You could just rename the project (.Xproj file and project folder) in TFS, delete the local folder structure and all of its contents, then do a get latest for the project.  All of this depends the notion of your source repository is completely up to date and compilable.</p>\n'}, {'answer_id': 49766, 'author': 'Dan Shield', 'author_id': 4633, 'author_profile': 'https://Stackoverflow.com/users/4633', 'pm_score': 5, 'selected': True, 'text': '<p>Just right click on the folder in TFS, and select Rename.  Once you commit the rename, TFS will make the changes on disk for you.  As Kevin pointed out, you will want to make sure that everything is checked in, because TFS will remove the old folder and everything in it, and pull down the renamed folder with the current version of the files in it.</p>\n\n<p>One final note:  You can\'t rename a folder that you haven\'t mapped, or that you haven\'t done a "Get" from.  I don\'t know why, but TFS will disable the Rename option in these cases.</p>\n\n<p>At least that\'s what happened to me, if I remember correctly.</p>\n'}, {'answer_id': 379312, 'author': 'Community', 'author_id': -1, 'author_profile': 'https://Stackoverflow.com/users/-1', 'pm_score': 1, 'selected': False, 'text': "<p>Here are steps that worked for me in Visual Studio 2008 with TFS:</p>\n\n<ol>\n<li>Close solution.</li>\n<li>Rename project folders in Source Control Explorer (right-click -> rename). This duplicates code into newly named folders.</li>\n<li>Open the solution, and in Solution Explorer, remove the old folders/projects and add the new, properly named, duplicates, (on old projects, right-click -> remove, then on the solution, right-click->Add->Existing Project...)</li>\n</ol>\n\n<p>OR: After step 2, you can open the solution's .sln file in a text editor, and manually update the project folder names.  If you do this, you might need to manually check-out the .sln file to be sure your changes will be checked in (&lt;- important!).</p>\n"}, {'answer_id': 7273579, 'author': 'ozziepeeps', 'author_id': 597054, 'author_profile': 'https://Stackoverflow.com/users/597054', 'pm_score': 1, 'selected': False, 'text': "<p>My particular configuration is VS2010 connecting to TFS2008. I tried some of the other solutions here, but had problems. I found the following worked for me:-</p>\n\n<ol>\n<li>Remove project in folder to be renamed from solution </li>\n<li>Save solution</li>\n<li>Rename folder containing removed project in <strong>TFS source control</strong> (this renames locally on your hard disk)</li>\n<li>Add project back to the solution from the new location</li>\n<li>Save solution</li>\n<li>Commit to source control</li>\n</ol>\n\n<p>Now, you'll have the folder rename and the solution re-map all committed under one changeset.</p>\n"}, {'answer_id': 10853509, 'author': 'Scott Munro', 'author_id': 81595, 'author_profile': 'https://Stackoverflow.com/users/81595', 'pm_score': 7, 'selected': False, 'text': '<ol>\n<li><strong>Check in</strong> all pending changes within the folder and ensure that all other team members to do the same.</li>\n<li>Ensure that you have a copy of the folder in your working directory (otherwise, you will not have the option to rename the folder in the <em>Source Control Explorer</em> in the next step). <strong>Get latest version</strong> on the folder to get a copy if you don\'t already have one.</li>\n<li><strong>Close the solution</strong>.</li>\n<li><strong>Rename</strong> the folder within the <em>Source Control Explorer</em>. This will move all of the files that are tracked in source control from the original folder on your file system to the new one. Note that files not tracked by source control will remain in the original folder - you will probably want to remove this folder once you have confirmed that there are no files there that you need.</li>\n<li><strong>Open the solution</strong> and select \'<strong><code>No</code></strong>\' when prompted to get projects that were newly added to the solution from source control. You will get a warning that one of the projects in the solution could not be loaded.</li>\n<li><strong>Select the project</strong> within <em>Solution Explorer</em>. \n\n<blockquote>\n  <p>Note that it will be grayed out and marked as <em>\'Unavailable\'</em>.</p>\n</blockquote></li>\n<li>Open the <strong>Properties</strong> pane.</li>\n<li><strong>Edit the <em>\'File Path\'</em></strong> property either directly or using the \'<code>...</code>\' button. \n\n<blockquote>\n  <p>Note also that this property is <a href="http://blogs.msmvps.com/deborahk/solution-files-change-project-directory-location/" rel="noreferrer">only editable in Visual Studio 2010</a>. In newer versions of Visual Studio, you will need to manually edit the project paths within the solution file.</p>\n</blockquote></li>\n<li>Right-click on the project in the <em>Solution Explore</em>r and select <strong>Reload Project</strong> from the context menu. If you get an error message saying that the project cannot be loaded from the original folder, try closing the solution, deleting the suo file in the same folder as the solution file then reopening the solution.</li>\n<li><strong>Check in</strong> the changes as a single changeset.</li>\n<li>Have other team members \'Get latest version\' for the solution (right click on the solution within <em>Solution Explorer</em> and select \'Get Latest Version\' from the context menu.</li>\n</ol>\n\n<hr>\n\n<blockquote>\n  <p>Note: Other suggested solutions that involve removing and then re-adding the project to the solution will break project references.</p>\n</blockquote>\n\n<p>If you perform these steps then you might also consider renaming the following to suit.</p>\n\n<ol>\n<li>Project File</li>\n<li>Default/Root Namespace</li>\n<li>Assembly</li>\n</ol>\n\n<p>Also, consider modifying the values of the following <a href="http://msdn.microsoft.com/en-us/library/4w8c1y2s.aspx" rel="noreferrer">assembly attributes</a>.</p>\n\n<ol>\n<li><code>AssemblyProductAttribute</code></li>\n<li><code>AssemblyDescriptionAttribute</code></li>\n<li><code>AssemblyTitleAttribute</code></li>\n</ol>\n'}, {'answer_id': 60267331, 'author': 'Daniel Congrove', 'author_id': 1937348, 'author_profile': 'https://Stackoverflow.com/users/1937348', 'pm_score': 1, 'selected': False, 'text': '<p>For <strong>Visual Studio 2019</strong> and <strong>ASP.NET Core 2.2</strong> I had to modify Scott Munro\'s answer slightly. Here\'s what worked for me:</p>\n\n<p>Before you start: Check in all changes and make a backup of your solution.</p>\n\n<ol>\n<li>Rename the project using the <em>Solution Explorer</em> (i.e. right click the project and click rename).</li>\n<li>Rename the project folder in <em>Source Control Explorer</em>. </li>\n<li>Open your solution\'s <em>.sln</em> file in a text editor, and fix the file path. (Replace any references to "OldProjectName" with "NewProjectName").</li>\n<li>Reload your solution in Visual Studio.</li>\n<li>Find and replace all the old namespaces with the new project name.</li>\n<li>Done. Check in changes.</li>\n</ol>\n\n<p>I had to do step 1 first in order to get the project to load after fixing the file path in step 3.</p>\n'}]
['https://Stackoverflow.com/questions/49066', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/5110/']