Rename solution and related projects in a ASP.NET web application

Cindy See 166 Reputation points
2022-09-29T08:31:48.363+00:00

Hi,
I would like to reuse the solution and its projects for another purpose
thus I would like to rename the solution and all projects that are attached to it.
May i know the fastest and proper way of doing it?

If it is not possible, i will continue using this solution and modified the contents of the projects
but during deployment to production environment
what are the things that I have to change in order not to mix up with other solution ?

Thank you for your advice.

ASP.NET
ASP.NET
A set of technologies in the .NET Framework for building web applications and XML web services.
3,303 questions
0 comments No comments
{count} votes

Accepted answer
  1. Sreeju Nair 11,621 Reputation points
    2022-09-29T08:47:50.457+00:00

    If you are planning to reuse your code, it is better to create your code as libraries and use those libraries in several projects.

    https://learn.microsoft.com/en-us/dotnet/standard/class-libraries

    If you want the same project to be deployed multiple times, it is possible without duplicating the project itself. You can have as many IIS applications and use the same solution. In general you may change the connection strings and other settings from applicaiton to application.

    2 people found this answer helpful.

2 additional answers

Sort by: Most helpful
  1. Lan Huang-MSFT 26,121 Reputation points Microsoft Vendor
    2022-09-29T09:54:58.647+00:00

    Hi @Cindy See ,
    If you want to rename the solution, you can follow the steps below.

    1. Backup.First things first, make sure to always create a backup file.Simply copy your project to a different directory.
    2. In Solution Explorer, right-click the project, select Rename, and enter a new name.
    3. In Solution Explorer, right-click the project and select Properties. On the Application tab, change the "Assembly name" and "Default namespace".
    4. Open any .cs and rename all namespace
    5. Change the AssemblyTitle and AssemblyProduct in Properties/AssemblyInfo.cs.
    6. Delete bin and obj directories physically.
    7. Rename the project physical folder directory.
    8. Open the Sln file (within notepad or any editor) and change the path to the project.
    9. Cleans and Rebuild the project

    Best regards,
    Lan Huang


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    10 people found this answer helpful.

  2. K. Yasin ABLAY 0 Reputation points
    2023-07-11T12:17:17.44+00:00

    Thank you. Its Work!

    0 comments No comments