aspnetcore: Blazor .NET Core 3 preview 9: The type or namespace name 'RenderTreeBuilder' does not exist in the namespace 'Microsoft.AspNetCore.Components.Rendering'

Following the guide here, I immediately get an error when trying to run the app.

dotnet --version
3.0.100-preview9-014004  

dotnet new -i Microsoft.AspNetCore.Blazor.Templates::3.0.0-preview8.19405.7
dotnet new blazorwasm -o WebApplication1
dotnet run

obj\Debug\netstandard2.0\RazorDeclaration\Shared\MainLayout.razor.g.cs(49,91): error CS0234: The type or namespace name 'RenderTreeBuilder' does not exist in the namespace 'Microsoft.AspNetCore.Components.Rendering' (are you missing an assembly reference?) [C:\Users\AlexMcLean\git\WebApplication1\WebApplication1.csproj]
obj\Debug\netstandard2.0\RazorDeclaration\App.razor.g.cs(49,91): error CS0234: The type or namespace name 'RenderTreeBuilder' does not exist in the namespace 'Microsoft.AspNetCore.Components.Rendering' (are you missing an assembly reference?) [C:\Users\AlexMcLean\git\WebApplication1\WebApplication1.csproj]
obj\Debug\netstandard2.0\RazorDeclaration\Shared\NavMenu.razor.g.cs(49,91): error CS0234: The type or namespace name 'RenderTreeBuilder' does not exist in the namespace 'Microsoft.AspNetCore.Components.Rendering' (are you missing an assembly reference?) [C:\Users\AlexMcLean\git\WebApplication1\WebApplication1.csproj]
obj\Debug\netstandard2.0\RazorDeclaration\Shared\SurveyPrompt.razor.g.cs(49,91): error CS0234: The type or namespace name 'RenderTreeBuilder' does not exist in the namespace 'Microsoft.AspNetCore.Components.Rendering' (are you missing an assembly reference?) [C:\Users\AlexMcLean\git\WebApplication1\WebApplication1.csproj]
obj\Debug\netstandard2.0\RazorDeclaration\Pages\Index.razor.g.cs(51,91): error CS0234: The type or namespace name 'RenderTreeBuilder' does not exist in the namespace 'Microsoft.AspNetCore.Components.Rendering' (are you missing an assembly reference?) [C:\Users\AlexMcLean\git\WebApplication1\WebApplication1.csproj]
obj\Debug\netstandard2.0\RazorDeclaration\Pages\FetchData.razor.g.cs(51,91): error CS0234: The type or namespace name 'RenderTreeBuilder' does not exist in the namespace 'Microsoft.AspNetCore.Components.Rendering' (are you missing an assembly reference?) [C:\Users\AlexMcLean\git\WebApplication1\WebApplication1.csproj]
obj\Debug\netstandard2.0\RazorDeclaration\Pages\Counter.razor.g.cs(51,91): error CS0234: The type or namespace name 'RenderTreeBuilder' does not exist in the namespace 'Microsoft.AspNetCore.Components.Rendering' (are you missing an assembly reference?) [C:\Users\AlexMcLean\git\WebApplication1\WebApplication1.csproj]

The build failed. Fix the build errors and run again.

Is it because the link to the templates should be updated?

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 22 (7 by maintainers)

Most upvoted comments

I guess this might have been going through the pipeline while I posted this, as I had suspected the templates needed to be updated to reflect that .NET Core 3.0 preview 9 was out now (and what I had installed).

dotnet new -i Microsoft.AspNetCore.Blazor.Templates::3.0.0-preview9.19424.4

Thus, you do not need to update to the latest Visual Studio (for anyone like me who’s trying to move away from VS and towards VS Code).

I had similar issues. I had to replace Microsoft.AspNetCore.Components.Rendering with Microsoft.AspNetCore.Components.RenderTree.RenderTreeBuilder and it worked for me

I was in the same boat as RealTadango, but running the command that mclean25 posted to update the templates fixed it for me.

Strange. I updated VS to 16.3.0 Preview 3.0, updated the template but still the error remains. Even a new clean Blazor app has the same issue. What am i missing?