How to rename a project in Visual Studio 2010

  • You can rename any project by right-clicking the project in Solution Explorer and select Rename. But this doesn’t change the physical folder name. To change the physical folder name, first right-select “Open Folder in Window Explorer”, then close the solution (File> Close Solution), then rename the folder that contains the project (the folder in which the *.csproj file resides).
  • The assembly name and the namespace of the projects under this solution still remain unchanged (suppose you’ve changed namespaces and/or assembly names for some of them), to fix this, while the solution is still closed, open their individual .csproj file with a text editor and modify the <RootNamespace> and <AssemblyName> nodes to reflect the changes.
  • Last but not least,  When you reopen the solution, VS won’t be able to load the project. To fix this, remove the stale project entry in Solution Explorer, then right-select the Properties of the solution > Add > Existing Project and navigate to select the *.csproj file.
About these ads

4 Responses to “How to rename a project in Visual Studio 2010”

  1. Norman Says:

    In case you are too lazy to do all these steps manually, there is a tool (prototype) I wrote exactly for this task. Also supports subversion for now. Check out http://normankosmal.com/wordpress/?p=54.

    Norman

  2. jay Says:

    I looked through 10 various posts, nothing worked but this worked perfectly. thanks you sir

  3. laguy88 Says:

    Thanks from LA, Ca and Happy New Year !

    Many times, I download VS sample code but want to rename solutions and projects to something more meaningful to me..

  4. Stephan Says:

    Thank you. These instructions worked great.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


Follow

Get every new post delivered to your Inbox.

%d bloggers like this: