dotnet / dotnet/aspnetcore

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

Open
#51,151 7 comments 4 reactions 1 assignee Assigned to @Copilot View on GitHub
analyzer area-blazor bug copilot-candidate Pillar: Dev Experience Priority:2
Dominant language
C#
Stars
38.4k
Forks
10.9k
Avg merge
2d 10h
Merged PRs (30d)
281

Description

### Is there an existing issue for this?

- [X] 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

```

@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_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.