简体   繁体   English

如何重命名 Blazor WASM 项目?

[英]How do I rename a Blazor WASM project?

I renamed sln, csproj and namespace but am getting these three errors which I didn't have prior to renaming.我重命名了 sln、csproj 和命名空间,但出现了这三个我在重命名之前没有的错误。

   /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) 

You could create a project template from within Visual Studio您可以从 Visual Studio 中创建项目模板

在此处输入图像描述

This will let you "re-create" your project with a new name, it will keep everything you have but rename some namespaces to your new name.这将允许您使用新名称“重新创建”您的项目,它将保留您拥有的所有内容,但将一些命名空间重命名为您的新名称。

Also helpful if you need to create "project templates" to be re-used in your organization如果您需要创建“项目模板”以在您的组织中重复使用,这也很有帮助

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM