C# 如何重命名Blazor WASM项目?

C# 如何重命名Blazor WASM项目?,c#,visual-studio,C#,Visual Studio,我重命名了sln、csproj和namespace,但是我得到了这三个在重命名之前没有的错误 /App.razor(66,66): Error CS0246: The type or namespace name 'MainLayout' could not be found (are you missing a using directive or an assembly reference?) (CS0246) /obj/Debug/net5.0/Razor/App.razor.

我重命名了sln、csproj和namespace,但是我得到了这三个在重命名之前没有的错误

   /App.razor(66,66): Error CS0246: The type or namespace name 'MainLayout' could not be found (are you missing a using directive or an assembly reference?) (CS0246) 
  /obj/Debug/net5.0/Razor/App.razor.g.cs(155,155): Error CS1662: Cannot convert lambda expression to intended delegate type because some of the return types in the block are not implicitly convertible to the delegate return type (CS1662)
   /App.razor(37,37): Error CS0246: The type or namespace name 'MainLayout' could not be found (are you missing a using directive or an assembly reference?) (CS0246) 

您可以从VisualStudio中创建项目模板

这将允许您使用新名称“重新创建”您的项目,它将保留您拥有的所有内容,但将一些名称空间重命名为您的新名称


如果您需要创建“项目模板”以便在您的组织中重复使用,这也很有用

您是否更改了
\u Imports.razor
文件?我更改了,我在那里更改了名称空间