Rename Maui project in NET 6

Dani_S 3,046 Reputation points
2023-05-02T11:39:25.6733333+00:00

Hi,

  1. I want to rename MAUI project name with all its namespaces, it possible ?
  2. I want to rename class library project with all its namespaces, it possible ?

Thanks,

Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
4,752 questions
.NET MAUI
.NET MAUI
A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
3,043 questions
{count} votes

Accepted answer
  1. Yonglun Liu (Shanghai Wicresoft Co,.Ltd.) 37,266 Reputation points Microsoft Vendor
    2023-05-03T05:43:51.57+00:00

    Hello,

    In Visual Studio, you could quickly change your project's namespace by following these steps:

    Step 1. Open your MAUI project in visual studio.

    Step 2. Use the Ctrl+Shift+H shortcut keys to open the Replace in files window.

    Step 3. Fill in the above input field with the namespace you need to replace, such as MauiApp10. Then, in the input field below, fill in the new name you used to replace the original namespace, such as MauiAppRenamed.

    Step 4. Click the drop-down arrow in the input box on the right side of File types and select !*\bin\*;!*\obj\*;!*\.*.

    Step 5. Click Replace All button.

    After that, You would see that MauiApp10 has been automatically replaced with MauiAppRenamed throughout the project.

    Step 6. Right-click your project in Solution Explorer and select Rename to replace it with a new name, such as MauiAppRenamed.

    For class libraries, you could replace namespaces with the same steps.

    Best Regards,

    Alec Liu.


    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.

    0 comments No comments

0 additional answers

Sort by: Most helpful