Skip to content

Using @ref and @rendermode on the same call site produces an unhelpful error message #51151

@hannespreishuber

Description

@hannespreishuber

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

Just done a simple test to get how the things are working

new template

[Parameter]
 public int MyProperty { get; set; }

 private void IncrementCount()
 {
     currentCount++;
     MyProperty = currentCount;

and

<BlazorApp8.Client.Pages.Counter @ref="Counter1" />
@Counter1?.MyProperty

@code{
    BlazorApp8.Client.Pages.Counter Counter1;
}

Expected Behavior

see the counter value

my intention was to use server side and embed a WASM part and how to communicate between the components

Steps To Reproduce

No response

Exceptions (if any)

System.InvalidCastException: Unable to cast object of type 'Microsoft.AspNetCore.Components.Endpoints.SSRRenderModeBoundary' to type 'BlazorApp8.Client.Pages.Counter'.

.NET Version

8.0.100-rc.1.23455.8

Anything else?

No response

Metadata

Metadata

Assignees

Labels

Pillar: Dev ExperiencePriority:2Work that is important, but not critical for the releaseanalyzerIndicates an issue which is related to analyzer experiencearea-blazorIncludes: Blazor, Razor ComponentsbugThis issue describes a behavior which is not expected - a bug.copilot-candidate

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions