Got error by Rendermode

By the DOC

https://blazor.syncfusion.com/documentation/file-upload/getting-started-with-web-app

It said to put the code

@* desired render mode define here *@
@rendermode InteractiveAuto

So I setup myproject though Blazor web app according to DOC example.

But it shows the error

An unhandled exception occurred while processing the request.

InvalidOperationException: A component of type 'ExcelToGrid_Mine.Components.Pages.Home' has render mode 'InteractiveAutoRenderMode', but the required endpoints are not mapped on the server. When calling 'MapRazorComponents', add a call to 'AddInteractiveWebAssemblyRenderMode'. For example, 'builder.MapRazorComponents<...>.AddInteractiveWebAssemblyRenderMode()'

Microsoft.AspNetCore.Components.Endpoints.SSRRenderModeBoundary.AssertRenderModeIsConfigured<TRequiredMode>(Type componentType, IComponentRenderMode specifiedMode, IComponentRenderMode[] configuredModes, string expectedCall)


When I remove 'rendermode' code line, then it is not working.(though click the button of upload, nothing happened.


And when I look at the template project which from the 'extention' menu in Vs2022 with File upload.

it had  

@rendermode InteractiveServer


So finally, when i fix it from InteractiveAuto to InteractiveServer, everything is okay.


So what the wrong with the DOC explanation?


3 Replies

KP Kokila Poovendran Syncfusion Team February 12, 2024 10:24 AM UTC

Hi LEE,


Thank you for bringing this issue to our attention regarding the usage of the rendermode directive as mentioned in our documentation for the Blazor Web App.


Upon reviewing your concern, it seems there might be a misunderstanding regarding the render modes and project configurations. The error you encountered suggests that the server does not support the specified render mode, 'InteractiveAuto'. This mode is designed to work in WebAssembly projects.


From your description, it appears that your project might have been created with a server-side project template, which does not support 'InteractiveAuto'. This is likely the cause of the issue you faced.


In our documentation, we recommend using 'InteractiveAuto' as it's suitable for Blazor WebAssembly projects. However, for server-side Blazor projects, 'InteractiveServer' is the appropriate choice.


We appreciate your understanding in this matter. If you have any further questions or require assistance, please don't hesitate to reach out.


Regards,

Kokila Poovendran.



LE LEE February 13, 2024 02:13 PM UTC

Thank you so much, 

Kokila Poovendran.


https://blazor.syncfusion.com/documentation/file-upload/getting-started-with-web-app

https://blazor.syncfusion.com/documentation/file-upload/getting-started


There are two categories under / File Upload / Getting Started.


The introduction under below is written in WebApp part.


@* desired render mode define here *@

@rendermode InteractiveAuto


As far as I know, WebApp is the new term of MS which means integrated version, Server&WASM.

And actually the defaulf mod for rendering isn't InterActiveAuto


I just followed your document instruction for WebApp.


I might made some misunderstaing?


Regards,

Mr.LEE.



YS Yohapuja Selvakumaran Syncfusion Team February 15, 2024 01:13 PM UTC

Hi Lee,


We apologize for this confusion caused. We have reviewed your concern and understand that you are experiencing confusion regarding the use of render modes in Blazor. It seems that switching to the InteractiveServer render mode might address the issue you are facing.


Here is a code snippet demonstrating how to set the render mode to InteractiveServer:

@rendermode InteractiveServer


This change may help resolve the issue you encountered. However, please note that using InteractiveServer render mode might have implications on the performance and behavior of your Blazor components.


For more detailed insights and understanding, we recommend referring to the provided resources:


Blog: https://www.syncfusion.com/blogs/post/blazor-ui-support-dotnet-8.aspx


Documentation:
​https://learn.microsoft.com/en-us/aspnet/core/blazor/components/render-modes?view=aspnetcore-8.0


These resources should provide comprehensive information on render modes in Blazor and how to use them effectively.




Regards,

Yohapuja S


Attachment: BlazorApp1_f9355b0c.zip

Loader.
Up arrow icon