Blazor Project模板 - 某些名称空间不重命名

发布于 2025-01-25 03:47:05 字数 140 浏览 2 评论 0原文

我正在尝试制作一个大火项目模板。 当我尝试从该模板创建一个项目时,所有名称空间都正确地更改为项目名称,除了_imports.razor和在Razor中的@usiss语句中。成分。仍然有与模板中相同的名称空间。

I am trying to make a Blazor project template.
When i try to create a project from that template, all namespaces change properly to the project name, except for that in _Imports.razor and in the @using statement in the razor component. There are still the same namespaces as in the template.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

离不开的别离 2025-02-01 03:47:05

这是我典型的_imports.razor在模板中的文件

@using System.Net.Http
@using Microsoft.AspNetCore.Authorization
@using Microsoft.AspNetCore.Components.Forms
@using Microsoft.AspNetCore.Components.Routing
@using Microsoft.AspNetCore.Components.Web
@using Microsoft.AspNetCore.Components.Web.Virtualization
@using Microsoft.JSInterop
@using $ext_projectname$
@using $ext_projectname$.Core

和VSTEM Plate文件中的相关部分:

    <TemplateContent>
        <Project TargetFileName="Blazr.Demo.UI.csproj" File="Blazr.Demo.UI.csproj" ReplaceParameters="true">
      .......
            <ProjectItem ReplaceParameters="true" TargetFileName="_Imports.razor">_Imports.razor</ProjectItem>
            <ProjectItem ReplaceParameters="true" TargetFileName="program.cs">program.cs</ProjectItem>
        </Project>
    </TemplateContent>

如果需要上下文,则可以在此处看到整个模板: https://github.com/shauncurtis/blazr.demo.temo.template

Here is one of my typical _Imports.razor files in a template

@using System.Net.Http
@using Microsoft.AspNetCore.Authorization
@using Microsoft.AspNetCore.Components.Forms
@using Microsoft.AspNetCore.Components.Routing
@using Microsoft.AspNetCore.Components.Web
@using Microsoft.AspNetCore.Components.Web.Virtualization
@using Microsoft.JSInterop
@using $ext_projectname$
@using $ext_projectname$.Core

and the relevant section in the vstemplate file:

    <TemplateContent>
        <Project TargetFileName="Blazr.Demo.UI.csproj" File="Blazr.Demo.UI.csproj" ReplaceParameters="true">
      .......
            <ProjectItem ReplaceParameters="true" TargetFileName="_Imports.razor">_Imports.razor</ProjectItem>
            <ProjectItem ReplaceParameters="true" TargetFileName="program.cs">program.cs</ProjectItem>
        </Project>
    </TemplateContent>

If you want the context, you can see the whole template here: https://github.com/ShaunCurtis/Blazr.Demo.Template

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文