Skip to content

RenderFragment named "Input" throws error when enclosed in Razor markup #7065

Open
@mrlife

Description

@mrlife

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

This throws the errors listed below:

@if (show)
{
    <ChildComponent>
        <Input>
            RenderFragment text
        </Input>
    </ChildComponent>
}

This does not throw errors due to the Input RenderFragment being renamed to Input2:

@if (show)
{
    <ChildComponent>
        <Input2>
            RenderFragment text
        </Input2>
    </ChildComponent>
}

This does not throw errors due to the Input RenderFragment not being in razor markup:

<ChildComponent>
    <Input>
        RenderFragment text
    </Input>
</ChildComponent>

Expected Behavior

No error should be thrown.

Steps To Reproduce

Please see this repro project: https://github.com/mrlife/RenderFragmentTest

Exceptions (if any)

Error RZ1025: The "ChildComponent" element was not closed. All elements must be either self-closing or have a matching end tag.
Error RZ1034: Found a malformed 'ChildComponent' tag helper. Tag helpers must have a start and end tag or be self closing.
Error RZ9981: Unexpected closing tag 'Input' with no matching start tag.
Error RZ9981: Unexpected closing tag 'ChildComponent' with no matching start tag.
Error RZ1026: Encountered end tag "ChildComponent" with no matching start tag. Are your start/end tags properly balanced?

.NET Version

7.0.100-preview.6.22352.1

Anything else?

The project is ASP.NET Core 6, though issue remains if changed to ASP.NET Core 7.

VS Mac: 17.4 build 715

.NET SDK:
 Version:   7.0.100-preview.6.22352.1
 Commit:    492644e08e

Runtime Environment:
 OS Name:     Mac OS X
 OS Version:  12.5
 OS Platform: Darwin
 RID:         osx.12-arm64
 Base Path:   /usr/local/share/dotnet/sdk/7.0.100-preview.6.22352.1/

Host:
  Version:      7.0.0-preview.6.22324.4
  Architecture: arm64
  Commit:       d3fa592f6d

.NET SDKs installed:
  6.0.101 [/usr/local/share/dotnet/sdk]
  6.0.200 [/usr/local/share/dotnet/sdk]
  6.0.201 [/usr/local/share/dotnet/sdk]
  6.0.202 [/usr/local/share/dotnet/sdk]
  6.0.203 [/usr/local/share/dotnet/sdk]
  6.0.300 [/usr/local/share/dotnet/sdk]
  6.0.301 [/usr/local/share/dotnet/sdk]
  6.0.400-preview.22330.6 [/usr/local/share/dotnet/sdk]
  6.0.400 [/usr/local/share/dotnet/sdk]
  7.0.100-preview.6.22352.1 [/usr/local/share/dotnet/sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 6.0.1 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 6.0.2 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 6.0.3 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 6.0.4 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 6.0.5 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 6.0.6 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 6.0.8 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 7.0.0-preview.6.22330.3 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 6.0.1 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 6.0.2 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 6.0.3 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 6.0.4 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 6.0.5 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 6.0.6 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 6.0.8 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 7.0.0-preview.6.22324.4 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]

Other architectures found:
  x64   [/usr/local/share/dotnet/x64]

Environment variables:
  Not set

global.json file:
  Not found

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions