markjprice / cs12dotnet8

Repository for the Packt Publishing book titled "C# 12 and .NET 8 - Modern Cross-Platform Development Fundamentals" by Mark J. Price
564 stars 164 forks source link

'RenderModeAuto' could not be found #35

Closed LesF closed 3 months ago

LesF commented 3 months ago

I have opened the PracticalApps solution then updated all the nuget packages to the latest stable. Then I compiled the solution, and get several errors in two of the projects. In Northwind.Blazor.Wasm page Fibonacci.razor I get:

Error CS0246 The type or namespace name 'RenderModeAuto' could not be found (are you missing a using directive or an assembly reference?) Northwind.Blazor.Wasm D:\Projects\cs12dotnet8\code\PracticalApps\Northwind.Blazor.Wasm\Pages\Fibonacci.razor 1 Active

Error CS0246 The type or namespace name 'RenderModeAutoAttribute' could not be found (are you missing a using directive or an assembly reference?) Northwind.Blazor.Wasm D:\Projects\cs12dotnet8\code\PracticalApps\Northwind.Blazor.Wasm\Pages\Fibonacci.razor 1 Active

Haven't worked thru the chapter yet, there might be something I need to tweak, just wondered if this solution is expected to build ok as it is.

markjprice commented 3 months ago

Sorry, that's my mistake. I've fixed it in the GitHub repository code now. The following statement:

@attribute [RenderModeAuto]

Should have been:

@rendermode RenderMode.InteractiveAuto

https://github.com/markjprice/cs12dotnet8/blob/main/code/PracticalApps/Northwind.Blazor.Wasm/Pages/Fibonacci.razor#L1

The solution will build after fixing that.

LesF commented 3 months ago

All good now. Thanks