Rider | Blazor 8 | @onclick directive considered vanilla onclick

I am working in .NET 8 and getting a new Blazor project setup. There is an odd issue happening in Rider where in some .razor files the Blazor @onclick directive is being considered by Rider to be a vanilla onclick. This means methods are not recognized and Change Event Args are being typed as Render Tree Builder in lambda expressions.

 

This is not consistent across the project and even in the same file there are times I can invalidate caches or create a new razor file and have no issue, then Rider again later and the razor file shows the @onclicks incorrectly.

OS: Mac
Rider 2025.3.3
Blazor .NET 8 Web App (Interactive Server Razor files)

Supporting Images: Upload id: 2026_03_01_P7MEwGpi2ZWsuHhCmMFVYG (files: OnclickDirectiveActsLikeVanilla.png, DirectiveOnMethodDoesNotResolve.png)

0
3 comments

Hi Eric Z,
thank you for your question!

Please create a minimal sample project that reproduces this issue on your side and share it with us.
Upload it to our server https://uploads.jetbrains.com/ and provide us with the Upload ID. (The uploaded data will be accessible only to our team and will be used solely for investigating this issue.) 

Additionally, it will be helpful if you collect logs after reproducing the problem using Help | Collect Logs and Diagnostic Data and send them together with a sample project.

Please clarify if I understood you correctly that Invalidate Caches and Restart also help resolve this issue temporarily.
Thanks!

0

Hello Aleksandr Nagovitsyn ,

I will attempt to recreate with a minimal project if possible. Though this seems to happen in a larger solution after moving through many files. I'll be sure to capture logs next time it occurs.

 

The post was more to see if there was something known for this or if maybe I had a setting incorrect somewhere. For those who can't get to the shared images from the post and might stumble on this later:

`<input type="text" @onclick="MethodName" />`  -→ “MethodName” is not recognized as a method but considered a string.

`<input type="text" @onclick="@MethodName" />`  -→ “MethodName” is recognized as a method, but a warning appears stating the method is being considered as an object.

This is happening in Razor files, predominantly where the `@code` is in the same file. When it happens it is not consistent across files, will try and see if there are any other factors if it happens again.


Invalidating cache does consistently resolve this and it takes quite a lot of time for it to pop back up.

0

Eric Z, thank you for your update.

I understand that when this issue occurs only while working with your large project, creating a test project reproducer is usually not easy. 
However, it would be very helpful for further investigation if you can provide IDE logs collected via Help | Collect Logs and Diagnostic Data after the issue occurs. And also please share a screenshot of this issue.
Please upload it to our server https://uploads.jetbrains.com/ and provide us with the Upload ID.

Additionally, there is a similar report on comment to RSRP-502474 issue in our YouTrack.
Feel free to add your comments or feedback whether you have the same problem as described.
Thanks!

0

Please sign in to leave a comment.