Starts in:
2 DAYS
1 HR
25 MIN
46 SEC
Starts in:
2 D
1 H
25 M
46 S
Open Closed

Renaming a project #8186


User avatar
0
dazza_74 created

Once you have created a project / solution, how easy is it to rename it? as I notice the name you chose initially is used everywhere e.g. variable for AppName, in the Privacy and Cookies Policies for the name of the app, for company name in copyright for the page footers, for DB name and throughtout the code in the naming of key files.

I tried a rename in Visual Studio which is how I would normally do it but this just takes an absolute age to complete, even crashing on a couple of attempts. And then if it does complete you have multiple errors to fix manually.

So the question is do you have a proper way one should rename a project if later the original name chosen no longer works for the project?

Thanks


7 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    There is no shortcut, you can search and rename globally.

    Thanks.

  • User Avatar
    0
    dazza_74 created

    Should never be that difficult to rename a project!! or at least the AppName variable should work for ALL display purposes including privacy, cookie, footers etc, so you can just change it in one place

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    The project name may be in cs, js, csthml, csproj, etc. files. , we can't use a variable for unified management.

    We have to search and rename globally.

    Sorry for that.

  • User Avatar
    0
    dazza_74 created

    Perhaps a powershell script to run that can rename in all required areas?

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    You can open your whole project in VS code. then search and replace globally.

  • User Avatar
    0
    dazza_74 created

    Thanks, had already tried that in VS, Notepad++ and VS Code, but still doesn't work that well, as:

    1. Doesn't rename files / folders so you still have to manually rename project folder, and the.csproj file name as a minumum before you can open, build and run the project. And still lots of other files still have name of old project

    1. Breaks the menu titles as shown below - Home becomes Menu:Home for some reason.

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    Doesn't rename files / folders so you still have to manually rename project folder, and the.csproj file name as a minumum before you can open, build and run the project. And still lots of other files still have name of old project

    This is inevitable. We will consider providing a tool to rename files and folders in the future.

    Breaks the menu titles as shown below - Home becomes Menu:Home for some reason.

    Please check the localized code, it might be a problem with the JONS file path.

Made with ❤️ on ABP v9.1.0-preview. Updated on November 20, 2024, 13:06