Skip to content

WASM Blazor Error: RAZORGENERATE : error RZ3008: Tag helpers cannot target tag name '<global namespace>. #13881

@mylifelineio

Description

@mylifelineio

Version: 3.0.0-preview9.19424.4

Describe the bug

Getting the following error separating View from Model inheriting from ComponentBase. This is a WASM Blazor project.

RAZORGENERATE : error RZ3008: Tag helpers cannot target tag name '.ViewCustomerModel' because it contains a '<' character.

To Reproduce

public class ViewCustomerModel: ComponentBase
{
    [Inject]
    protected IDataService Data {get;set;}

    [Parameter] 
    public Guid CustomerId {get;set;}
    public Customer Customer {get;set;}

    protected override async Task OnInitializedAsync() 
    {
        await Load();
    }

    private async Task Cancel() => await Load();

    private async Task Load()
    {
        Customer = await Data.Load<Customer>(CustomerId);
    }

    private async Task Save(EditContext editContext)
    {
        if (editContext.Validate())
        {
            await Data.Save<Customer>(Customer);
        }
    }
}

Expected behavior

No compile error.

Additional context

Build FAILED.

RAZORGENERATE : error RZ3008: Tag helpers cannot target tag name '.ViewCustomerModel' because it contains a '<' character. [/Users/antonswanevelder/_mor/mor.customer/app/mor.customer.app.csproj]
.
.

Works as @code on View

@page "/viewcustomer"
@page "/viewcustomer/{customerId}"
@using mor.customer.Models;
@using mor.Services;
@inject IDataService Data;
.
.
.
@code {
    [Parameter] 
    public Guid CustomerId {get;set;}
    public Customer Customer {get;set;}

    protected override async Task OnInitializedAsync() 
    {
        await Load();
    }

    private async Task Cancel() => await Load();

    private async Task Load()
    {
        Customer = await Data.Load<Customer>(CustomerId);
    }

    private async Task Save(EditContext editContext)
    {
        if (editContext.Validate())
        {
            await Data.Save<Customer>(Customer);
        }
    }

    private async Task OnKeyAction(KeyboardEventArgs e)
    {
        if (e.Key == "Escape") 
        {
            await Cancel();
        }
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs: Author FeedbackThe author of this issue needs to respond in order for us to continue investigating this issue.area-blazorIncludes: Blazor, Razor Components

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions