Home > Mobile >  how to remove prefixes from projectes in hosted blazorwasm project
how to remove prefixes from projectes in hosted blazorwasm project

Time:10-16

I want to set up a hosted blazorwasm project via the dotnet cli using the following command

dotnet new blazorwasm --hosted

Say that i executed this command in a folder called test then all the projects inside this new solution will have the prefix test. in visual studio.

enter image description here

I want my project to not have these prefixes so i tried just renaming the projects in vs 2022 but this results in the following error.

enter image description here

How do i safely remove the prefixes from these project without crashing my builds?

CodePudding user response:

If you want to change names of your projects, you can search and replace project name, then change project folder and project file. It works, I do this sometimes.

Follow these Steps:

  1. Open your whole solution folder using vscode. Go to search tab and replace all occurence of that project name e.g. test.Shared to NewProjectName. Make sure that you match case and whole word.
  2. Change the folder name for test.Shared to NewProjectName.
  3. Change test.Shared.csproj inside that folder to NewProjectName.csproj.

After that you are done, compile and run.

CodePudding user response:

You need to edit the project solution (.sln) file:

Project("{...}") = "Server", "test\Server\test.Server.csproj", "{823DA873-9616-4245-AC45-B59535AA865B}"
EndProject
Project("{...}") = "Client", "test\Client\test.Client.csproj", "{30EBEA6F-3384-4EEF-ABCC-22954275A2AC}"
EndProject
Project("{...}") = "Shared", "test\Shared\test.Shared.csproj", "{3BEE92B9-A658-4825-B43F-10DB6850E60F}"
EndProject
  • Related