Help with Blazor Component Error: 'RenderMode' does not contain a definition for 'InteractiveServer' #57955
Unanswered
ainsleybernard
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello, I need some help on how to use non-routable components in razor pages, I am upgrading my project from .net 6 to .net 8.
I am getting the following error in my razor page
'RenderMode' does not contain a definition for 'InteractiveServer'
My index.cshtml contains the following code:
<component type="typeof(Counter)" render-mode="InteractiveServer"/>
From what I understand the only valid modes are
https://learn.microsoft.com/en-us/aspnet/core/mvc/views/tag-helpers/built-in/component-tag-helper?view=aspnetcore-8.0#additional-resources
I thought we are supposed to use "InteractiveServer" instead of "Server"? I may have confused myself with docs
https://learn.microsoft.com/en-us/aspnet/core/migration/70-80?view=aspnetcore-8.0&tabs=visual-studio
Can someone please help clarify?
I attempt to add the following
@using static Microsoft.AspNetCore.Components.Web.RenderMode
to my _Imports.razorbut this does not resolve the issue, could the problem be due to my project structure?
For reference my project is setup as the following
Razor Component
_Layout.cshtml
My Startup Configuration looks like this, shorten for brevity
My _Imports.razor looks like this
My _ViewImports.cshtml looks like this
I have the following Folder Structure; I placed my razor component in the Shared folder under pages.
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions