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.
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.
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:
- Open your whole solution folder using
vscode
. Go tosearch
tab and replace all occurence of that project name e.g.test.Shared
toNewProjectName
. Make sure that you match case and whole word. - Change the folder name for
test.Shared
toNewProjectName
. - Change
test.Shared.csproj
inside that folder toNewProjectName.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