重命名 Blazor 项目中的默认文件夹



我想将 Blazor 服务器项目中的Shared文件夹重命名为Components,如何才能正确执行此操作?似乎命名空间基于文件夹名称,但一定有一种方法吧?

您可以将文件夹重命名为组件。这确实会更改命名空间,请像这样编辑_Imports.razor文件:

@*@using MyApp.Shared*@  -- remove this line
@using MyApp.Components

最新更新