@rendermode InteractiveAuto not found for Blazor .net 8

Rabe, Jens 35 Reputation points
2023-11-16T08:07:25.83+00:00

I had a sample application with Blazor and .net 8 and had the following in there:

@attribute [RenderModeInteractiveAuto]

Now, I am supposed to use:

@rendermode InteractiveAuto

But this doesn't compile.

The name 'InteractiveAuto' does not exist in the current context

There does exist InteractiveAutoRenderMode though.

Do I have to take any extra steps? Extra imports?

Blazor
Blazor
A free and open-source web framework that enables developers to create web apps using C# and HTML being developed by Microsoft.
1,442 questions
0 comments No comments
{count} votes

Accepted answer
  1. Qing Guo - MSFT 886 Reputation points Microsoft Vendor
    2023-11-17T09:52:20.9233333+00:00

    Hi @Rabe, Jens,

    You can check your _Imports.razor file in your .client project, make sure it has this line:

    @using static Microsoft.AspNetCore.Components.Web.RenderMode
    

    Besides, you can update the Visual Studio to the latest version(my project is 17.9.0 Preview 1.0) , and you can click the Help-->Check for Updates like:

    112

    then the "The name 'InteractiveAuto' does not exist in the current context" will disppear:

    114

    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    Best regards,

    Qing Guo

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful