razor: Blazor regression in 7.0.302 SDK

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

Hello,

After updating the SDK to version 7.0.302, we encountered numerous errors in our MudBlazor project. One particular example is the ambiguous call issue shown in the screenshot below. It appears that the Razor parser has become more strict, and the unnecessary @ symbol may be causing the problem. However, I’m unsure how to resolve all the errors, such as The attribute names could not be inferred from bind attribute 'bind-IsVisible' or Multiple components use the tag 'MudSwitch'. Could you provide some insight into their meaning?

While I don’t have a reproduction repository available, you can review the logs at the following link for further details: GitHub Logs

If you clone the MudBlazor repository and compile it with the 7.0.302 SDK version, you’ll have a better understanding of the overall situation.

NB! creating global.json where you set previous SDK version does solve the problem, but this is not really a solution.

It would be greatly appreciated if you could provide any information or documentation regarding the changes and how to address them. Are there any workarounds available? I’m also curious why a breaking change was introduced in the .NET 7 SDK rather than do them in .NET 8.

Thank you for your assistance.

Exceptions (if any)

Error list example
Error: /home/runner/work/MudBlazor/MudBlazor/src/MudBlazor/Components/DataGrid/MudDataGrid.razor(158,79): error CS1026: ) expected [/home/runner/work/MudBlazor/MudBlazor/src/MudBlazor/MudBlazor.csproj::TargetFramework=net7.0] [/home/runner/work/MudBlazor/MudBlazor/src/MudBlazor.Docs/MudBlazor.Docs.csproj]
Error: /home/runner/work/MudBlazor/MudBlazor/src/MudBlazor/Components/DataGrid/MudDataGrid.razor(158,79): error CS1003: Syntax error, ',' expected [/home/runner/work/MudBlazor/MudBlazor/src/MudBlazor/MudBlazor.csproj::TargetFramework=net7.0] [/home/runner/work/MudBlazor/MudBlazor/src/MudBlazor.Docs/MudBlazor.Docs.csproj]
##[debug]Dropping file value '/home/runner/work/MudBlazor/MudBlazor/src/MudBlazor/Microsoft.NET.Sdk.Razor.SourceGenerators/Microsoft.NET.Sdk.Razor.SourceGenerators.RazorSourceGenerator/Components_DataGrid_MudDataGrid_razor.g.cs'. Path does not exist
Error: /home/runner/work/MudBlazor/MudBlazor/src/MudBlazor/Microsoft.NET.Sdk.Razor.SourceGenerators/Microsoft.NET.Sdk.Razor.SourceGenerators.RazorSourceGenerator/Components_DataGrid_MudDataGrid_razor.g.cs(970,32): error CS1002: ; expected [/home/runner/work/MudBlazor/MudBlazor/src/MudBlazor/MudBlazor.csproj::TargetFramework=net7.0] [/home/runner/work/MudBlazor/MudBlazor/src/MudBlazor.Docs/MudBlazor.Docs.csproj]
##[debug]Dropping file value '/home/runner/work/MudBlazor/MudBlazor/src/MudBlazor/Microsoft.NET.Sdk.Razor.SourceGenerators/Microsoft.NET.Sdk.Razor.SourceGenerators.RazorSourceGenerator/Components_DataGrid_MudDataGrid_razor.g.cs'. Path does not exist
Error: /home/runner/work/MudBlazor/MudBlazor/src/MudBlazor/Microsoft.NET.Sdk.Razor.SourceGenerators/Microsoft.NET.Sdk.Razor.SourceGenerators.RazorSourceGenerator/Components_DataGrid_MudDataGrid_razor.g.cs(970,32): error CS1513: } expected [/home/runner/work/MudBlazor/MudBlazor/src/MudBlazor/MudBlazor.csproj::TargetFramework=net7.0] [/home/runner/work/MudBlazor/MudBlazor/src/MudBlazor.Docs/MudBlazor.Docs.csproj]
Error: /home/runner/work/MudBlazor/MudBlazor/src/MudBlazor/Components/DataGrid/MudDataGrid.razor(193,71): error CS1026: ) expected [/home/runner/work/MudBlazor/MudBlazor/src/MudBlazor/MudBlazor.csproj::TargetFramework=net7.0] [/home/runner/work/MudBlazor/MudBlazor/src/MudBlazor.Docs/MudBlazor.Docs.csproj]
Error: /home/runner/work/MudBlazor/MudBlazor/src/MudBlazor/Components/DataGrid/MudDataGrid.razor(193,71): error CS1003: Syntax error, ',' expected [/home/runner/work/MudBlazor/MudBlazor/src/MudBlazor/MudBlazor.csproj::TargetFramework=net7.0] [/home/runner/work/MudBlazor/MudBlazor/src/MudBlazor.Docs/MudBlazor.Docs.csproj]
##[debug]Dropping file value '/home/runner/work/MudBlazor/MudBlazor/src/MudBlazor/Microsoft.NET.Sdk.Razor.SourceGenerators/Microsoft.NET.Sdk.Razor.SourceGenerators.RazorSourceGenerator/Components_DataGrid_MudDataGrid_razor.g.cs'. Path does not exist
Error: /home/runner/work/MudBlazor/MudBlazor/src/MudBlazor/Microsoft.NET.Sdk.Razor.SourceGenerators/Microsoft.NET.Sdk.Razor.SourceGenerators.RazorSourceGenerator/Components_DataGrid_MudDataGrid_razor.g.cs(1145,32): error CS1002: ; expected [/home/runner/work/MudBlazor/MudBlazor/src/MudBlazor/MudBlazor.csproj::TargetFramework=net7.0] [/home/runner/work/MudBlazor/MudBlazor/src/MudBlazor.Docs/MudBlazor.Docs.csproj]
##[debug]Dropping file value '/home/runner/work/MudBlazor/MudBlazor/src/MudBlazor/Microsoft.NET.Sdk.Razor.SourceGenerators/Microsoft.NET.Sdk.Razor.SourceGenerators.RazorSourceGenerator/Components_DataGrid_MudDataGrid_razor.g.cs'. Path does not exist
Error: /home/runner/work/MudBlazor/MudBlazor/src/MudBlazor/Microsoft.NET.Sdk.Razor.SourceGenerators/Microsoft.NET.Sdk.Razor.SourceGenerators.RazorSourceGenerator/Components_DataGrid_MudDataGrid_razor.g.cs(1145,32): error CS1513: } expected [/home/runner/work/MudBlazor/MudBlazor/src/MudBlazor/MudBlazor.csproj::TargetFramework=net7.0] [/home/runner/work/MudBlazor/MudBlazor/src/MudBlazor.Docs/MudBlazor.Docs.csproj]
Error: /home/runner/work/MudBlazor/MudBlazor/src/MudBlazor/Components/DataGrid/MudDataGrid.razor(38,55): error CS1026: ) expected [/home/runner/work/MudBlazor/MudBlazor/src/MudBlazor/MudBlazor.csproj::TargetFramework=net7.0] [/home/runner/work/MudBlazor/MudBlazor/src/MudBlazor.Docs/MudBlazor.Docs.csproj]
Error: /home/runner/work/MudBlazor/MudBlazor/src/MudBlazor/Components/DataGrid/MudDataGrid.razor(38,55): error CS1003: Syntax error, ',' expected [/home/runner/work/MudBlazor/MudBlazor/src/MudBlazor/MudBlazor.csproj::TargetFramework=net7.0] [/home/runner/work/MudBlazor/MudBlazor/src/MudBlazor.Docs/MudBlazor.Docs.csproj]
##[debug]Dropping file value '/home/runner/work/MudBlazor/MudBlazor/src/MudBlazor/Microsoft.NET.Sdk.Razor.SourceGenerators/Microsoft.NET.Sdk.Razor.SourceGenerators.RazorSourceGenerator/Components_DataGrid_MudDataGrid_razor.g.cs'. Path does not exist
Error: /home/runner/work/MudBlazor/MudBlazor/src/MudBlazor/Microsoft.NET.Sdk.Razor.SourceGenerators/Microsoft.NET.Sdk.Razor.SourceGenerators.RazorSourceGenerator/Components_DataGrid_MudDataGrid_razor.g.cs(1366,39): error CS1002: ; expected [/home/runner/work/MudBlazor/MudBlazor/src/MudBlazor/MudBlazor.csproj::TargetFramework=net7.0] [/home/runner/work/MudBlazor/MudBlazor/src/MudBlazor.Docs/MudBlazor.Docs.csproj]
##[debug]Dropping file value '/home/runner/work/MudBlazor/MudBlazor/src/MudBlazor/Microsoft.NET.Sdk.Razor.SourceGenerators/Microsoft.NET.Sdk.Razor.SourceGenerators.RazorSourceGenerator/Components_DataGrid_MudDataGrid_razor.g.cs'. Path does not exist
Error: /home/runner/work/MudBlazor/MudBlazor/src/MudBlazor/Microsoft.NET.Sdk.Razor.SourceGenerators/Microsoft.NET.Sdk.Razor.SourceGenerators.RazorSourceGenerator/Components_DataGrid_MudDataGrid_razor.g.cs(1366,39): error CS1513: } expected [/home/runner/work/MudBlazor/MudBlazor/src/MudBlazor/MudBlazor.csproj::TargetFramework=net7.0] [/home/runner/work/MudBlazor/MudBlazor/src/MudBlazor.Docs/MudBlazor.Docs.csproj]
Error: /home/runner/work/MudBlazor/MudBlazor/src/MudBlazor/Components/DataGrid/MudDataGrid.razor(14,57): error CS1003: Syntax error, ',' expected [/home/runner/work/MudBlazor/MudBlazor/src/MudBlazor/MudBlazor.csproj::TargetFramework=net7.0] [/home/runner/work/MudBlazor/MudBlazor/src/MudBlazor.Docs/MudBlazor.Docs.csproj]
Error: /home/runner/work/MudBlazor/MudBlazor/src/MudBlazor/Components/DataGrid/MudDataGrid.razor(14,73): error CS1003: Syntax error, ',' expected [/home/runner/work/MudBlazor/MudBlazor/src/MudBlazor/MudBlazor.csproj::TargetFramework=net7.0] [/home/runner/work/MudBlazor/MudBlazor/src/MudBlazor.Docs/MudBlazor.Docs.csproj]
##[debug]Dropping file value '/home/runner/work/MudBlazor/MudBlazor/src/MudBlazor/MudBlazor.SourceCodeGenerator/MudBlazor.SourceCodeGenerator.FastEnumDescriptionGenerator/OverflowBehaviorMudEnumExtensions.g.cs'. Path does not exist
Warning: /home/runner/work/MudBlazor/MudBlazor/src/MudBlazor/MudBlazor.SourceCodeGenerator/MudBlazor.SourceCodeGenerator.FastEnumDescriptionGenerator/OverflowBehaviorMudEnumExtensions.g.cs(25,13): warning CS0618: 'OverflowBehavior.FilpOnOpen' is obsolete: 'This value has a typo and will be removed. Please use FlipOnOpen' [/home/runner/work/MudBlazor/MudBlazor/src/MudBlazor/MudBlazor.csproj::TargetFramework=net7.0] [/home/runner/work/MudBlazor/MudBlazor/src/MudBlazor.Docs/MudBlazor.Docs.csproj]
Warning: /home/runner/work/MudBlazor/MudBlazor/src/MudBlazor/Components/Avatar/MudAvatar.razor(7,36): warning CS0618: 'MudAvatar.Image' is obsolete: 'Add a MudImage as the ChildContent instead' [/home/runner/work/MudBlazor/MudBlazor/src/MudBlazor/MudBlazor.csproj::TargetFramework=net7.0] [/home/runner/work/MudBlazor/MudBlazor/src/MudBlazor.Docs/MudBlazor.Docs.csproj]
Warning: /home/runner/work/MudBlazor/MudBlazor/src/MudBlazor/Components/Avatar/MudAvatar.razor(9,29): warning CS0618: 'MudAvatar.Image' is obsolete: 'Add a MudImage as the ChildContent instead' [/home/runner/work/MudBlazor/MudBlazor/src/MudBlazor/MudBlazor.csproj::TargetFramework=net7.0] [/home/runner/work/MudBlazor/MudBlazor/src/MudBlazor.Docs/MudBlazor.Docs.csproj]
Warning: /home/runner/work/MudBlazor/MudBlazor/src/MudBlazor/Components/Avatar/MudAvatar.razor(9,42): warning CS0618: 'MudAvatar.Alt' is obsolete: 'Add a MudImage as the ChildContent instead' [/home/runner/work/MudBlazor/MudBlazor/src/MudBlazor/MudBlazor.csproj::TargetFramework=net7.0] [/home/runner/work/MudBlazor/MudBlazor/src/MudBlazor.Docs/MudBlazor.Docs.csproj]
Warning: /home/runner/work/MudBlazor/MudBlazor/src/MudBlazor/Components/DataGrid/PropertyColumn.cs(28,36): warning CS8618: Non-nullable field '_compiledPropertyFunc' must contain a non-null value when exiting constructor. Consider declaring the field as nullable. [/home/runner/work/MudBlazor/MudBlazor/src/MudBlazor/MudBlazor.csproj::TargetFramework=net7.0] [/home/runner/work/MudBlazor/MudBlazor/src/MudBlazor.Docs/MudBlazor.Docs.csproj]
Warning: /home/runner/work/MudBlazor/MudBlazor/src/MudBlazor/Components/DataGrid/PropertyColumn.cs(29,48): warning CS8618: Non-nullable field '_compiledPropertyFuncFor' must contain a non-null value when exiting constructor. Consider declaring the field as nullable. [/home/runner/work/MudBlazor/MudBlazor/src/MudBlazor/MudBlazor.csproj::TargetFramework=net7.0] [/home/runner/work/MudBlazor/MudBlazor/src/MudBlazor.Docs/MudBlazor.Docs.csproj]
Warning: /home/runner/work/MudBlazor/MudBlazor/src/MudBlazor/Components/DataGrid/MudDataGrid.razor(91,150): warning CS8974: Converting method group 'ToggleAsync' to non-delegate type 'object'. Did you intend to invoke the method? [/home/runner/work/MudBlazor/MudBlazor/src/MudBlazor/MudBlazor.csproj::TargetFramework=net7.0] [/home/runner/work/MudBlazor/MudBlazor/src/MudBlazor.Docs/MudBlazor.Docs.csproj]
Warning: /home/runner/work/MudBlazor/MudBlazor/src/MudBlazor/Components/DataGrid/MudDataGrid.razor(91,150): warning CS8974: Converting method group 'ToggleAsync' to non-delegate type 'object'. Did you intend to invoke the method? [/home/runner/work/MudBlazor/MudBlazor/src/MudBlazor/MudBlazor.csproj::TargetFramework=net7.0] [/home/runner/work/MudBlazor/MudBlazor/src/MudBlazor.Docs/MudBlazor.Docs.csproj]
Warning: /home/runner/work/MudBlazor/MudBlazor/src/MudBlazor/Components/DataGrid/MudDataGrid.razor(95,63): warning CS8974: Converting method group 'HideAllColumnsAsync' to non-delegate type 'object'. Did you intend to invoke the method? [/home/runner/work/MudBlazor/MudBlazor/src/MudBlazor/MudBlazor.csproj::TargetFramework=net7.0] [/home/runner/work/MudBlazor/MudBlazor/src/MudBlazor.Docs/MudBlazor.Docs.csproj]
Warning: /home/runner/work/MudBlazor/MudBlazor/src/MudBlazor/Components/DataGrid/MudDataGrid.razor(98,63): warning CS8974: Converting method group 'ShowAllColumnsAsync' to non-delegate type 'object'. Did you intend to invoke the method? [/home/runner/work/MudBlazor/MudBlazor/src/MudBlazor/MudBlazor.csproj::TargetFramework=net7.0] [/home/runner/work/MudBlazor/MudBlazor/src/MudBlazor.Docs/MudBlazor.Docs.csproj]
Error: /home/runner/work/MudBlazor/MudBlazor/src/MudBlazor/Components/DataGrid/MudDataGrid.razor(155,118): error CS0103: The name 'item' does not exist in the current context [/home/runner/work/MudBlazor/MudBlazor/src/MudBlazor/MudBlazor.csproj::TargetFramework=net7.0] [/home/runner/work/MudBlazor/MudBlazor/src/MudBlazor.Docs/MudBlazor.Docs.csproj]
Error: /home/runner/work/MudBlazor/MudBlazor/src/MudBlazor/Components/DataGrid/MudDataGrid.razor(156,131): error CS0103: The name 'item' does not exist in the current context [/home/runner/work/MudBlazor/MudBlazor/src/MudBlazor/MudBlazor.csproj::TargetFramework=net7.0] [/home/runner/work/MudBlazor/MudBlazor/src/MudBlazor.Docs/MudBlazor.Docs.csproj]
Error: /home/runner/work/MudBlazor/MudBlazor/src/MudBlazor/Components/DataGrid/MudDataGrid.razor(164,76): error CS0103: The name 'item' does not exist in the current context [/home/runner/work/MudBlazor/MudBlazor/src/MudBlazor/MudBlazor.csproj::TargetFramework=net7.0] [/home/runner/work/MudBlazor/MudBlazor/src/MudBlazor.Docs/MudBlazor.Docs.csproj]
Error: /home/runner/work/MudBlazor/MudBlazor/src/MudBlazor/Components/DataGrid/MudDataGrid.razor(158,105): error CS0103: The name 'item' does not exist in the current context [/home/runner/work/MudBlazor/MudBlazor/src/MudBlazor/MudBlazor.csproj::TargetFramework=net7.0] [/home/runner/work/MudBlazor/MudBlazor/src/MudBlazor.Docs/MudBlazor.Docs.csproj]
Error: /home/runner/work/MudBlazor/MudBlazor/src/MudBlazor/Components/DataGrid/MudDataGrid.razor(158,157): error CS0103: The name 'item' does not exist in the current context [/home/runner/work/MudBlazor/MudBlazor/src/MudBlazor/MudBlazor.csproj::TargetFramework=net7.0] [/home/runner/work/MudBlazor/MudBlazor/src/MudBlazor.Docs/MudBlazor.Docs.csproj]
Error: /home/runner/work/MudBlazor/MudBlazor/src/MudBlazor/Components/DataGrid/MudDataGrid.razor(169,104): error CS0103: The name 'item' does not exist in the current context [/home/runner/work/MudBlazor/MudBlazor/src/MudBlazor/MudBlazor.csproj::TargetFramework=net7.0] [/home/runner/work/MudBlazor/MudBlazor/src/MudBlazor.Docs/MudBlazor.Docs.csproj]
Error: /home/runner/work/MudBlazor/MudBlazor/src/MudBlazor/Components/DataGrid/MudDataGrid.razor(173,100): error CS0103: The name 'item' does not exist in the current context [/home/runner/work/MudBlazor/MudBlazor/src/MudBlazor/MudBlazor.csproj::TargetFramework=net7.0] [/home/runner/work/MudBlazor/MudBlazor/src/MudBlazor.Docs/MudBlazor.Docs.csproj]
Error: /home/runner/work/MudBlazor/MudBlazor/src/MudBlazor/Components/DataGrid/MudDataGrid.razor(190,110): error CS0103: The name 'item' does not exist in the current context [/home/runner/work/MudBlazor/MudBlazor/src/MudBlazor/MudBlazor.csproj::TargetFramework=net7.0] [/home/runner/work/MudBlazor/MudBlazor/src/MudBlazor.Docs/MudBlazor.Docs.csproj]
Error: /home/runner/work/MudBlazor/MudBlazor/src/MudBlazor/Components/DataGrid/MudDataGrid.razor(191,123): error CS0103: The name 'item' does not exist in the current context [/home/runner/work/MudBlazor/MudBlazor/src/MudBlazor/MudBlazor.csproj::TargetFramework=net7.0] [/home/runner/work/MudBlazor/MudBlazor/src/MudBlazor.Docs/MudBlazor.Docs.csproj]
Error: /home/runner/work/MudBlazor/MudBlazor/src/MudBlazor/Components/DataGrid/MudDataGrid.razor(199,68): error CS0103: The name 'item' does not exist in the current context [/home/runner/work/MudBlazor/MudBlazor/src/MudBlazor/MudBlazor.csproj::TargetFramework=net7.0] [/home/runner/work/MudBlazor/MudBlazor/src/MudBlazor.Docs/MudBlazor.Docs.csproj]
Error: /home/runner/work/MudBlazor/MudBlazor/src/MudBlazor/Components/DataGrid/MudDataGrid.razor(193,97): error CS0103: The name 'item' does not exist in the current context [/home/runner/work/MudBlazor/MudBlazor/src/MudBlazor/MudBlazor.csproj::TargetFramework=net7.0] [/home/runner/work/MudBlazor/MudBlazor/src/MudBlazor.Docs/MudBlazor.Docs.csproj]
Error: /home/runner/work/MudBlazor/MudBlazor/src/MudBlazor/Components/DataGrid/MudDataGrid.razor(193,149): error CS0103: The name 'item' does not exist in the current context [/home/runner/work/MudBlazor/MudBlazor/src/MudBlazor/MudBlazor.csproj::TargetFramework=net7.0] [/home/runner/work/MudBlazor/MudBlazor/src/MudBlazor.Docs/MudBlazor.Docs.csproj]
Error: /home/runner/work/MudBlazor/MudBlazor/src/MudBlazor/Components/DataGrid/MudDataGrid.razor(204,96): error CS0103: The name 'item' does not exist in the current context [/home/runner/work/MudBlazor/MudBlazor/src/MudBlazor/MudBlazor.csproj::TargetFramework=net7.0] [/home/runner/work/MudBlazor/MudBlazor/src/MudBlazor.Docs/MudBlazor.Docs.csproj]
Error: /home/runner/work/MudBlazor/MudBlazor/src/MudBlazor/Components/DataGrid/MudDataGrid.razor(208,92): error CS0103: The name 'item' does not exist in the current context [/home/runner/work/MudBlazor/MudBlazor/src/MudBlazor/MudBlazor.csproj::TargetFramework=net7.0] [/home/runner/work/MudBlazor/MudBlazor/src/MudBlazor.Docs/MudBlazor.Docs.csproj]
Error: /home/runner/work/MudBlazor/MudBlazor/src/MudBlazor/Components/DataGrid/MudDataGrid.razor(242,27): error CS0103: The name 'context' does not exist in the current context [/home/runner/work/MudBlazor/MudBlazor/src/MudBlazor/MudBlazor.csproj::TargetFramework=net7.0] [/home/runner/work/MudBlazor/MudBlazor/src/MudBlazor.Docs/MudBlazor.Docs.csproj]
Error: /home/runner/work/MudBlazor/MudBlazor/src/MudBlazor/Components/DataGrid/MudDataGrid.razor(39,58): error CS0029: Cannot implicitly convert type 'Microsoft.AspNetCore.Components.ElementReference' to 'MudBlazor.MudDropContainer<MudBlazor.Column<T>>' [/home/runner/work/MudBlazor/MudBlazor/src/MudBlazor/MudBlazor.csproj::TargetFramework=net7.0] [/home/runner/work/MudBlazor/MudBlazor/src/MudBlazor.Docs/MudBlazor.Docs.csproj]
##[debug]Dropping file value '/home/runner/work/MudBlazor/MudBlazor/src/MudBlazor/Microsoft.NET.Sdk.Razor.SourceGenerators/Microsoft.NET.Sdk.Razor.SourceGenerators.RazorSourceGenerator/Components_DataGrid_MudDataGrid_razor.g.cs'. Path does not exist
Error: /home/runner/work/MudBlazor/MudBlazor/src/MudBlazor/Microsoft.NET.Sdk.Razor.SourceGenerators/Microsoft.NET.Sdk.Razor.SourceGenerators.RazorSourceGenerator/Components_DataGrid_MudDataGrid_razor.g.cs(1351,23): error CS1501: No overload for method 'AddAttribute' takes 4 arguments [/home/runner/work/MudBlazor/MudBlazor/src/MudBlazor/MudBlazor.csproj::TargetFramework=net7.0] [/home/runner/work/MudBlazor/MudBlazor/src/MudBlazor.Docs/MudBlazor.Docs.csproj]
Warning: /home/runner/work/MudBlazor/MudBlazor/src/MudBlazor/Components/DataGrid/MudDataGrid.razor(272,123): warning CS8974: Converting method group 'StringValueChangedAsync' to non-delegate type 'object'. Did you intend to invoke the method? [/home/runner/work/MudBlazor/MudBlazor/src/MudBlazor/MudBlazor.csproj::TargetFramework=net7.0] [/home/runner/work/MudBlazor/MudBlazor/src/MudBlazor.Docs/MudBlazor.Docs.csproj]
Warning: /home/runner/work/MudBlazor/MudBlazor/src/MudBlazor/Components/DataGrid/MudDataGrid.razor(277,127): warning CS8974: Converting method group 'NumberValueChangedAsync' to non-delegate type 'object'. Did you intend to invoke the method? [/home/runner/work/MudBlazor/MudBlazor/src/MudBlazor/MudBlazor.csproj::TargetFramework=net7.0] [/home/runner/work/MudBlazor/MudBlazor/src/MudBlazor.Docs/MudBlazor.Docs.csproj]
Warning: /home/runner/work/MudBlazor/MudBlazor/src/MudBlazor/Components/DataGrid/MudDataGrid.razor(285,86): warning CS8974: Converting method group 'CancelEditingItemAsync' to non-delegate type 'object'. Did you intend to invoke the method? [/home/runner/work/MudBlazor/MudBlazor/src/MudBlazor/MudBlazor.csproj::TargetFramework=net7.0] [/home/runner/work/MudBlazor/MudBlazor/src/MudBlazor.Docs/MudBlazor.Docs.csproj]
Error: /home/runner/work/MudBlazor/MudBlazor/src/MudBlazor/Components/DataGrid/MudDataGrid.razor(286,86): error CS1503: Argument 2: cannot convert from 'method group' to 'string?' [/home/runner/work/MudBlazor/MudBlazor/src/MudBlazor/MudBlazor.csproj::TargetFramework=net7.0] [/home/runner/work/MudBlazor/MudBlazor/src/MudBlazor.Docs/MudBlazor.Docs.csproj]
Warning: /home/runner/work/MudBlazor/MudBlazor/src/MudBlazor/Components/DataGrid/MudDataGrid.razor(297,37): warning CS8974: Converting method group 'ShowColumnsPanel' to non-delegate type 'object'. Did you intend to invoke the method? [/home/runner/work/MudBlazor/MudBlazor/src/MudBlazor/MudBlazor.csproj::TargetFramework=net7.0] [/home/runner/work/MudBlazor/MudBlazor/src/MudBlazor.Docs/MudBlazor.Docs.csproj]
Warning: /home/runner/work/MudBlazor/MudBlazor/src/MudBlazor/Components/DataGrid/MudDataGrid.razor(300,45): warning CS8974: Converting method group 'ExpandAllGroups' to non-delegate type 'object'. Did you intend to invoke the method? [/home/runner/work/MudBlazor/MudBlazor/src/MudBlazor/MudBlazor.csproj::TargetFramework=net7.0] [/home/runner/work/MudBlazor/MudBlazor/src/MudBlazor.Docs/MudBlazor.Docs.csproj]
Warning: /home/runner/work/MudBlazor/MudBlazor/src/MudBlazor/Components/DataGrid/MudDataGrid.razor(301,45): warning CS8974: Converting method group 'CollapseAllGroups' to non-delegate type 'object'. Did you intend to invoke the method? [/home/runner/work/MudBlazor/MudBlazor/src/MudBlazor/MudBlazor.csproj::TargetFramework=net7.0] [/home/runner/work/MudBlazor/MudBlazor/src/MudBlazor.Docs/MudBlazor.Docs.csproj]
Warning: /home/runner/work/MudBlazor/MudBlazor/src/MudBlazor/Components/DataGrid/MudDataGrid.razor(305,45): warning CS8974: Converting method group 'InvokeServerLoadFunc' to non-delegate type 'object'. Did you intend to invoke the method? [/home/runner/work/MudBlazor/MudBlazor/src/MudBlazor/MudBlazor.csproj::TargetFramework=net7.0] [/home/runner/work/MudBlazor/MudBlazor/src/MudBlazor.Docs/MudBlazor.Docs.csproj]
Warning: /home/runner/work/MudBlazor/MudBlazor/src/MudBlazor/Components/DataGrid/MudDataGrid.razor(402,112): warning CS8974: Converting method group 'RemoveFilterAsync' to non-delegate type 'object'. Did you intend to invoke the method? [/home/runner/work/MudBlazor/MudBlazor/src/MudBlazor/MudBlazor.csproj::TargetFramework=net7.0] [/home/runner/work/MudBlazor/MudBlazor/src/MudBlazor.Docs/MudBlazor.Docs.csproj]
Warning: /home/runner/work/MudBlazor/MudBlazor/src/MudBlazor/Components/DataGrid/MudDataGrid.razor(405,95): warning CS8974: Converting method group 'FieldChanged' to non-delegate type 'object'. Did you intend to invoke the method? [/home/runner/work/MudBlazor/MudBlazor/src/MudBlazor/MudBlazor.csproj::TargetFramework=net7.0] [/home/runner/work/MudBlazor/MudBlazor/src/MudBlazor.Docs/MudBlazor.Docs.csproj]
Warning: /home/runner/work/MudBlazor/MudBlazor/src/MudBlazor/Components/DataGrid/MudDataGrid.razor(425,95): warning CS8974: Converting method group 'StringValueChanged' to non-delegate type 'object'. Did you intend to invoke the method? [/home/runner/work/MudBlazor/MudBlazor/src/MudBlazor/MudBlazor.csproj::TargetFramework=net7.0] [/home/runner/work/MudBlazor/MudBlazor/src/MudBlazor.Docs/MudBlazor.Docs.csproj]
Warning: /home/runner/work/MudBlazor/MudBlazor/src/MudBlazor/Components/DataGrid/MudDataGrid.razor(430,99): warning CS8974: Converting method group 'NumberValueChanged' to non-delegate type 'object'. Did you intend to invoke the method? [/home/runner/work/MudBlazor/MudBlazor/src/MudBlazor/MudBlazor.csproj::TargetFramework=net7.0] [/home/runner/work/MudBlazor/MudBlazor/src/MudBlazor.Docs/MudBlazor.Docs.csproj]
Error: /home/runner/work/MudBlazor/MudBlazor/src/MudBlazor/Components/DataGrid/MudDataGrid.razor(437,61): error CS0121: The call is ambiguous between the following methods or properties: 'RenderTreeBuilder.AddContent(int, string?)' and 'RenderTreeBuilder.AddContent(int, RenderFragment?)' [/home/runner/work/MudBlazor/MudBlazor/src/MudBlazor/MudBlazor.csproj::TargetFramework=net7.0] [/home/runner/work/MudBlazor/MudBlazor/src/MudBlazor.Docs/MudBlazor.Docs.csproj]
Warning: /home/runner/work/MudBlazor/MudBlazor/src/MudBlazor/Components/DataGrid/MudDataGrid.razor(435,88): warning CS8974: Converting method group 'EnumValueChanged' to non-delegate type 'object'. Did you intend to invoke the method? [/home/runner/work/MudBlazor/MudBlazor/src/MudBlazor/MudBlazor.csproj::TargetFramework=net7.0] [/home/runner/work/MudBlazor/MudBlazor/src/MudBlazor.Docs/MudBlazor.Docs.csproj]
Error: /home/runner/work/MudBlazor/MudBlazor/src/MudBlazor/Components/DataGrid/MudDataGrid.razor(448,62): error CS0121: The call is ambiguous between the following methods or properties: 'RenderTreeBuilder.AddContent(int, string?)' and 'RenderTreeBuilder.AddContent(int, RenderFragment?)' [/home/runner/work/MudBlazor/MudBlazor/src/MudBlazor/MudBlazor.csproj::TargetFramework=net7.0] [/home/runner/work/MudBlazor/MudBlazor/src/MudBlazor.Docs/MudBlazor.Docs.csproj]
Warning: /home/runner/work/MudBlazor/MudBlazor/src/MudBlazor/Components/DataGrid/MudDataGrid.razor(446,89): warning CS8974: Converting method group 'BoolValueChanged' to non-delegate type 'object'. Did you intend to invoke the method? [/home/runner/work/MudBlazor/MudBlazor/src/MudBlazor/MudBlazor.csproj::TargetFramework=net7.0] [/home/runner/work/MudBlazor/MudBlazor/src/MudBlazor.Docs/MudBlazor.Docs.csproj]
Warning: /home/runner/work/MudBlazor/MudBlazor/src/MudBlazor/Components/DataGrid/MudDataGrid.razor(457,89): warning CS8974: Converting method group 'DateValueChanged' to non-delegate type 'object'. Did you intend to invoke the method? [/home/runner/work/MudBlazor/MudBlazor/src/MudBlazor/MudBlazor.csproj::TargetFramework=net7.0] [/home/runner/work/MudBlazor/MudBlazor/src/MudBlazor.Docs/MudBlazor.Docs.csproj]
Warning: /home/runner/work/MudBlazor/MudBlazor/src/MudBlazor/Components/DataGrid/MudDataGrid.razor(460,89): warning CS8974: Converting method group 'TimeValueChanged' to non-delegate type 'object'. Did you intend to invoke the method? [/home/runner/work/MudBlazor/MudBlazor/src/MudBlazor/MudBlazor.csproj::TargetFramework=net7.0] [/home/runner/work/MudBlazor/MudBlazor/src/MudBlazor.Docs/MudBlazor.Docs.csproj]
Warning: /home/runner/work/MudBlazor/MudBlazor/src/MudBlazor/Components/DataGrid/MudDataGrid.razor(466,95): warning CS8974: Converting method group 'StringValueChanged' to non-delegate type 'object'. Did you intend to invoke the method? [/home/runner/work/MudBlazor/MudBlazor/src/MudBlazor/MudBlazor.csproj::TargetFramework=net7.0] [/home/runner/work/MudBlazor/MudBlazor/src/MudBlazor.Docs/MudBlazor.Docs.csproj]
Warning: /home/runner/work/MudBlazor/MudBlazor/src/MudBlazor/Components/DataGrid/MudDataGrid.razor(485,95): warning CS8974: Converting method group 'StringValueChanged' to non-delegate type 'object'. Did you intend to invoke the method? [/home/runner/work/MudBlazor/MudBlazor/src/MudBlazor/MudBlazor.csproj::TargetFramework=net7.0] [/home/runner/work/MudBlazor/MudBlazor/src/MudBlazor.Docs/MudBlazor.Docs.csproj]
Warning: /home/runner/work/MudBlazor/MudBlazor/src/MudBlazor/Components/DataGrid/MudDataGrid.razor(490,99): warning CS8974: Converting method group 'NumberValueChanged' to non-delegate type 'object'. Did you intend to invoke the method? [/home/runner/work/MudBlazor/MudBlazor/src/MudBlazor/MudBlazor.csproj::TargetFramework=net7.0] [/home/runner/work/MudBlazor/MudBlazor/src/MudBlazor.Docs/MudBlazor.Docs.csproj]
Error: /home/runner/work/MudBlazor/MudBlazor/src/MudBlazor/Components/DataGrid/MudDataGrid.razor(497,61): error CS0121: The call is ambiguous between the following methods or properties: 'RenderTreeBuilder.AddContent(int, string?)' and 'RenderTreeBuilder.AddContent(int, RenderFragment?)' [/home/runner/work/MudBlazor/MudBlazor/src/MudBlazor/MudBlazor.csproj::TargetFramework=net7.0] [/home/runner/work/MudBlazor/MudBlazor/src/MudBlazor.Docs/MudBlazor.Docs.csproj]
Warning: /home/runner/work/MudBlazor/MudBlazor/src/MudBlazor/Components/DataGrid/MudDataGrid.razor(495,88): warning CS8974: Converting method group 'EnumValueChanged' to non-delegate type 'object'. Did you intend to invoke the method? [/home/runner/work/MudBlazor/MudBlazor/src/MudBlazor/MudBlazor.csproj::TargetFramework=net7.0] [/home/runner/work/MudBlazor/MudBlazor/src/MudBlazor.Docs/MudBlazor.Docs.csproj]
Error: /home/runner/work/MudBlazor/MudBlazor/src/MudBlazor/Components/DataGrid/MudDataGrid.razor(508,62): error CS0121: The call is ambiguous between the following methods or properties: 'RenderTreeBuilder.AddContent(int, string?)' and 'RenderTreeBuilder.AddContent(int, RenderFragment?)' [/home/runner/work/MudBlazor/MudBlazor/src/MudBlazor/MudBlazor.csproj::TargetFramework=net7.0] [/home/runner/work/MudBlazor/MudBlazor/src/MudBlazor.Docs/MudBlazor.Docs.csproj]

.NET Version

7.0.302

Anything else?

ambigious1

Post update 5/19/2023

Here are some solutions and workarounds for addressing certain errors and warnings:

  1. Multiple components use the tag 'componentName' (RZ9985): See https://github.com/dotnet/razor/issues/8718#issuecomment-1551181634 for more information and avilable workaround.
  2. The attribute names could not be inferred from bind attribute (RZ9991): See https://github.com/dotnet/razor/issues/8725#issuecomment-1554621146 for possible workaround, another options it to try latest NET 8 preview SDK instead.
  3. Found markup element with unexpected name 'componentName'. If this is intended to be a component, add a @using directive for its namespace (RZ10012): Try this workaround https://github.com/dotnet/razor/issues/8718#issuecomment-1553914035, another options it to try latest NET 8 preview SDK instead.
  4. The type or namespace name '' could not be found in the global namespace (are you missing an assembly reference?) (CS0400): Try to specify full qualifier https://github.com/dotnet/razor/issues/8729#issuecomment-1554202661, another options it to try latest NET 8 preview SDK instead.
  5. Cannot implicitly convert type 'Microsoft.AspNetCore.Components.ElementReference' to '[className]' (CS0029): No workaround available except trying the latest NET 8 preview sdk instead or downgrading the SDK to previous version.

Important Note: It is worth mentioning that Microsoft recommends work around the issues by pinning the 7.0.20xx SDK instead.

Downgrading SDK

One potential solution to address the issues caused by the new SDK version is to consider reverting to the previous SDK version: https://github.com/dotnet/razor/issues/8718#issuecomment-1554379109. It’s important to note that if you are using containers, you should also ensure that the SDK version is changed accordingly. You may need to update the Dockerfile or related configuration files to specify the desired SDK version, as mentioned in this comment: https://github.com/dotnet/razor/issues/8718#issuecomment-1554556220. Additionally, don’t forget to review other areas, such as GitHub workflows, or others CI/CD.

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Reactions: 22
  • Comments: 74 (16 by maintainers)

Most upvoted comments

Every newcomer to Blazor who has downloaded it in the last three weeks will be scratching their heads as to why their projects don’t build, and forever put off Blazor (maybe even .Net!).

@AASPLLC That’s not quite right: While this Razor compiler issue did impact a significant number of users, it doesn’t impact every Blazor app. Only a specific coding pattern will trigger this problem. Even so, it is a severe regression that we are working as fast as possible to get fixed.

Fixing this issue requires a patch release of the .NET SDK. Whenever we ship a patch release we have to be similarly careful that the patch doesn’t introduce any new issues across all .NET workloads, so it takes time to build and validate the patch before it’s released.

This is the second consecutive big Visual Studio update which has come with breaking Blazor regressions. I’m concerned at the lack of urgency to fix them. Why is this acceptable?

@paulguz-datapa It’s not acceptable, and we’re actively working to improve our quality control processes to make sure this doesn’t happen again. It caught us by surprise that this issue made it past our Razor compiler and ASP.NET Core tests. To address this, we’re working to broaden our test suite.

It’s worth noting that one of the reasons we’ve had some issues with the Razor compiler recently is because of the increased level of investment that we’re making in the compiler to improve performance and to enhance the Razor tooling experience. It’s unfortunate that these changes introduced regressions and some of the perf gains had to temporarily be rolled back. We learned the hard way that we need more tests, but that is now getting addressed.

Wanted to give everyone an update:

First want to apologize for the regression here. We made a substantial performance improvement to the design / build time experience in Razor that had this particular regression in it that we missed. We’re in the process of reverting that change at the moment and it will appear in the next servicing release of the 7.0.3xx .NET SDK. In the mean time advising impacted customers to pin back to the 7.0.2xx SDK. I’ll post back here when the fix is published.

This bug also impacts the .NET 8 SDK and will also be patched in it’s upcoming release.

Note: the fix is merged on our side. I verified it works for at least one of the repos listed here. Should be all set for next SDK release.

Just release the freakin fix. Why everyone should reset or adjust all of their dev/CI environment?

Or can we at least get a timeframe as to when you will be releasing the update?

So you have no facility in your release cycle for quickly patching major breaking regressions?

Generally servicing fixes have a much faster turn around time: usually measured in a week or two at most. Unfortunately the timing of this regression happened in effectively at the worst possible time in our .NET SDK release cycle. The fix itself was produced very quickly to our release pipeline but it still has to wait for the .NET SDK release to occur.

In the majority of cases our preference is for customers to wait for servicing fixes. As mentioned the turn around time for those is usually fairly speedy. That leads to customers pinning an old SDK for a week and then undoing that fairly shortly after.

I do recognize that there are cases where we’d want a faster turn around time for patches when we hit situations like this. It’s a facility we have in the C# compiler. Part of this bug made us realize we needed a similar facility for Razor and we’ve already begun work on that.

I’m concerned at the lack of urgency to fix them.

To be clear there is no lack of urgency here. This issue was noticed immediately and fixed very quickly afterwards. It was also a very visible issue internally. To the point we extended the servicing window for our releases to make sure this particular issue got fixed (not a small task). The delay is more a matter of the .NET SDK servicing schedule which has many other constraints on it. Looking forward though the Toolset package will give us the ability to fast patch bugs independent of the .NET SDK release.

This is the second consecutive big Visual Studio update which has come with breaking Blazor regressions.

When the previous bug shipped we looked at our quality process and how it slipped through. The core problem identified is we made a fix late in the cycle. That meant our internal consumers did not get an updated Razor compiler before RTM and hence we bypassed that quality layer. Had it been done earlier their setups would’ve caught it and alerted us. Effectively we lost the benefit of dogfooding. That is part of the reason why this particular bug was done extremely early in the cycle.

This particular regression though didn’t intersect with any of our existing test sources. It was a bit of a wake up call that our customers are using our tech in more creative ways than we are. As such we’ve been looking for more customer focused repos that we can use for testing in the future.

@333fred So you have no facility in your release cycle for quickly patching major breaking regressions? So many production Blazor apps are affected by this. Every newcomer to Blazor who has downloaded it in the last three weeks will be scratching their heads as to why their projects don’t build, and forever put off Blazor (maybe even .Net!).

This is the second consecutive big Visual Studio update which has come with breaking Blazor regressions. I’m concerned at the lack of urgency to fix them.

@danroth27 Why is this acceptable?

VS 17.6.3 and .NET 7.0.304 are out today, both of which contain the fixes for these problems:

Again, apologies for the length of time between getting these out; normally, we can get them out sooner, but this release had security patch implications (unrelated to razor, the details are in the release notes) and those are always a longer and more complicated release procedure.

While waiting for the patch, you install 7.0.203 SDK and add a file named global.json to the root of your solution. This will force the compiler to use the desired version. https://learn.microsoft.com/en-us/dotnet/core/tools/global-json

{ "sdk": { "version": "7.0.203" } }

Guys, please, test this stuff out more before releasing. And, add this as a unit test. I can’t imagine how many devs are affected by this issue and banging their heads against the wall, like I am. 😦 Reverting from 17.6.1 to 17.5.5 fixed the issue for me, however, doing that also reverted a bunch of my Visual Studio settings, including uninstalling extensions that I had installed, that I now have to reset, too. 😦

I wanted to emphasize the below point in Jared’s post here.

I do recognize that there are cases where we’d want a faster turn around time for patches when we hit situations like this. It’s a facility we have in the C# compiler. Part of this bug made us realize we needed a similar facility for Razor and we’ve already begun work on that.

We’ve recently merged a change to make Razor match our C# compiler experience here, which is: if you need a compiler with some hotfix, then you can now reference the latest Toolset package from our nightly NuGet feed. This should enable you to start using fixed versions of the Razor compiler within about a day of our devs merging the fix–independently of any scheduling concerns with servicing VS and .NET SDK.

Thankyou @danroth27 and @jaredpar for your detailed responses.

I appreciate you reviewing your practices and taking your time over this.

I, and the other subscribers to this issue, have taken a big risk and heavily invested in Blazor, and have been drumming our fingers waiting for a fix. What has got us frustrated is the lack of transparency as to why the fix existed but was not being released.

Us investors are still early-ish adopters compared to React etc, and any perceived lack of action on, or problems with, Blazor scares us in to thinking Blazor maybe wasn’t the right choice.

For what it’s worth, I really enjoy Blazor and am glad it exists. It’s not perfect (I hope there’s still a lot more to come with Hot Reload because I have to restart my Wasm app a lot), but it’s incredibly helpful to be able to share our server-side logic with the client, and do everything in C#. It’s also succint and easy to work with.

we’ve been looking for more customer focused repos that we can use for testing in the future.

Indeed, there are many real-world open-source repos you could build as part of your testing. MudBlazor was mentioned at the start of this thread so could be a good place to start.

It’s worth noting that one of the reasons we’ve had some issues with the Razor compiler recently is because of the increased level of investment that we’re making in the compiler to improve performance and to enhance the Razor tooling experience.

That great. But big changes don’t seem a good fit for minor releases; .Net 8 would a better fit, with the extensive testing that would be part of the longer release cycle.

this happens in .net 6 as well: https://developercommunity.visualstudio.com/t/Visual-Studio-1762-has-broken-Blazor-C/10382026

This is not because of .NET 6, it’s because of VS 17.6. It will be patched in the next servicing release of VS 17.6 - I do not believe I can say anything other than “soon” for this date though.

It has been a long three weeks, but hopefully something is coming soon. More transparency on a timeline would be appreciated for development-breaking issues like this.

This will be part of the next servicing release of .NET 7. Our release cycle for this is documented here: https://github.com/dotnet/core/blob/main/release-policies.md#servicing. Unless something drastic occurs, I expect 7.0.304 to release next patch Tuesday, 6/13.

We are working on rewriting the legacy system (quite big sw developed over 20+ years) and have chosen blazor for it. For now not regretting, but had this unpleasant surprise two days ago. No pressure, just saying that I am counting on you 😃

Another related issue seems to be that inheritance no longer works. The project builds but the component which inherits isn’t recognized and renders as html tag. Here is an example:

DbContextPage.razor (base type)

@using RadzenBlazorDemos.Data
@using RadzenBlazorDemos.Models.Northwind
@using Microsoft.EntityFrameworkCore

@inject IDbContextFactory<NorthwindContext> DbFactory

@code {
    protected NorthwindContext dbContext;

    protected override async Task OnInitializedAsync()
    {
        await base.OnInitializedAsync();

        if (dbContext == null)
        {
            dbContext = await DbFactory.CreateDbContextAsync();
            await dbContext.SeedAsync();
        }
    }
}

Component which no longer works:

@inherits DbContextPage

<div class="rz-p-sm-12 rz-text-align-center">
    <RadzenDropDown TValue="string" Value=@value Data=@companyNames Change="@(args => value = $"{args}")" Style="width: 100%; max-width: 400px;" />
</div>

@code {
    string value = "Around the Horn";
    IEnumerable<string> companyNames;

    protected override async Task OnInitializedAsync()
    {
        await base.OnInitializedAsync();

        companyNames = dbContext.Customers.Select(c => c.CompanyName).Distinct();
    }
}

Making DbContextPage a c# class works. It is probably related that it contains only a @code block and doesn’t render anything.

I have the same issue. - .net 7.0.302

I successfully worked around this* by updating -all- my components to use this structure, whether or not they already had .razor.cs files.

BaseThing.razor

  • Remove any @implements
  • Order of @directives mattered in at least one file (where it did not previously)
@using Namespace
@typeparam TThing
@inherits AnotherBase<TThing>

@* No other changes. *@

BaseThing.razor.cs

  • Basically treat as the primary decl., with the .razor using only the minimum @directives required to compile
  • Base class can be e.g. AnotherBase, or the framework ComponentBase
  • Interfaces
public partial class BaseThing<TThing> : AnotherBase<TThing>, IHasInterfaces {

    // Rest of code as normal - or just an empty class.
}

AnotherBase.cs

public partial class AnotherBase<TThing> : ComponentBase {

    // Rest of code as normal - or just an empty class.
}

*: “this” meaning a whole host of new build errors after installing 17.6 release VS, where 17.5 and 17.6 preview had no issues.

Seems this is another regression introduced by https://github.com/dotnet/razor/pull/8212. Test to reproduce:

[Fact, WorkItem("https://github.com/dotnet/razor/issues/8718")]
public async Task PartialClass()
{
    // Arrange
    var project = CreateTestProject(new()
    {
        ["Shared/Component1.razor"] = """
            <Component2 />
            """,
        ["Shared/Component2.razor"] = """
            @inherits ComponentBase

            @code {
                [Parameter]
                public RenderFragment? ChildContent { get; set; }
            }
            """
    }, new()
    {
        ["Component2.razor.cs"] = """
            using Microsoft.AspNetCore.Components;

            namespace MyApp.Shared;

            public partial class Component2 : ComponentBase
            {

            }
            """
    });
    var compilation = await project.GetCompilationAsync();
    var driver = await GetDriverAsync(project);

    // Act
    var result = RunGenerator(compilation!, ref driver);

    // Assert
    Assert.Empty(result.Diagnostics);
    Assert.Equal(2, result.GeneratedSources.Length);
}

Fails with error:

Shared/Component1.razor(1,1): error RZ9985: Multiple components use the tag 'Component2'. Components: MyApp.Shared.Component2, MyApp.Shared.Component2

(This is one of the errors, my hypothesis is that the other errors reported in this issue are a consequence of it.)

Btw, the workaround seems to be to remove the base class from the codebehind file (since it’s also specified in the Razor file), i.e.:

-public partial class Component2 : ComponentBase
+public partial class Component2

It’s beginning to feel like Blazor Server is going the way of Silverlight. And we’ve trusted Microsoft yet again. 😦 Who is managing Blazor Server? Please get your act together or you are going to lose Devs in droves. We’ve also been waiting patiently on Blazor Server

Hope not. Investing heavily in Blazor, particularly server and all good for now, except this regression.

same, it is the most amazing invention really. I don’t think it is going anywhere, just a really bad hiccup/setback.

While I can find this or that strange in Blazor I am as a whole very satisfied. I am able to use one language for backend, browser, with hybrid version also windows desktop. Rewriting 20+ years old legacy set of business applications where while I have decoupled frontend and backend, the business logic is still whole in the backend part. The frontend is easy and clean, once I setup the components. Impressed. I shiver thinking that I might ended doing React 😃

Just release the freakin fix. Why everyone should reset or adjust all of their dev/CI environment?

It has been a long three weeks, but hopefully something is coming soon. More transparency on a timeline would be appreciated for development-breaking issues like this.

@sofiageo

Hi @jaredpar maybe it’s implied but what about .NET 8? Most if not all issues are also present there.

Yes it also impacts .NET 8 as we ship the same compiler in both releases. The fix will also appear in the next .NET 8 SDK update.

Also if you have docker file you can use older version by settings this: FROM mcr.microsoft.com/dotnet/aspnet:7.0.4 AS base (for runtime version)

… FROM mcr.microsoft.com/dotnet/sdk:7.0.202 AS build (for SDK)

(This is one of the errors, my hypothesis is that the other errors reported in this issue are a consequence of it.)

Btw, the workaround seems to be to remove the base class from the codebehind file (since it’s also specified in the Razor file), i.e.:

-public partial class Component2 : ComponentBase
+public partial class Component2

It appears that removing MudBooleanInput<T> from the MudSwitch.razor.cs file resolves the issue and eliminates all errors in MudDataGrid.

I’ve experienced a handful of similar issues after installing 7.0.302 (including this one specifically)

For the could not be found in the global namespace issues, if I refactored the not-found, single file component to a component with a separate code-behind class, it fixed the issue. Bizarre.

Thanks for that info. Are you by any chance using components with inheritance? I think that may be related.

now it complains about workload wasi-experimental which cannot be installed because of missing dependencies in the azure nuget feed

Do you have the feeds ordered like this? Then I think it should first use the default nuget feed and only then the Azure feed (which should hence be used only for the toolset package which doesn’t exist in the default nuget feed).

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <packageSources>
    <clear />
    <add key="nuget" value="https://api.nuget.org/v3/index.json" />
    <add key="dotnet-tools" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json" />
  </packageSources>
</configuration>

Alternatively, I think you could use Package Source Mapping to ensure only the toolset package is installed from the Azure feed.

it is the most amazing invention really

Totally agree. We’ve been able to write some great prototypes using Blazor Server. But it seems the team is intent on delivering the reachitecture called “Blazor United” instead of improving Blazor Server to get it to where it needs to be as a professional app framework.

It’s beginning to feel like Blazor Server is going the way of Silverlight. And we’ve trusted Microsoft yet again. 😦 Who is managing Blazor Server? Please get your act together or you are going to lose Devs in droves. We’ve also been waiting patiently on Blazor Server

Hope not. Investing heavily in Blazor, particularly server and all good for now, except this regression.

same, it is the most amazing invention really. I don’t think it is going anywhere, just a really bad hiccup/setback.

It’s beginning to feel like Blazor Server is going the way of Silverlight. And we’ve trusted Microsoft yet again. 😦

Who is managing Blazor Server? Please get your act together or you are going to lose Devs in droves. I feel horrible for everyone having to waste a ton of time on this issue, only to find this ticket.

We’ve also been waiting patiently on “Pause and resume Blazor Server circuits (#30344)” for Blazor Server since v5, but this incredibly important ticket was blown off by the team as well. So much for using Blazor Server for professional apps (https://github.com/dotnet/aspnetcore/issues/30344#issuecomment-1532640022). 😦

Please! Blazor Server team … get it together!

couldn’t agree more, this is a complete outage to every dev on this version using blazor servers.

{
  "sdk": {
    "version": "7.0.200",
    "rollForward": "latestPatch"
  }
}

@OndrejVrsan I have this:

{ "sdk": { "version": "7.0.203" } }

@TheCollegedude how did you reverted? Do you use global.config to specify SDK your project should use? We use this configuration to “revert” to earlier SDK with no issues.

{
  "sdk": {
    "version": "7.0.200",
    "rollForward": "latestPatch"
  }
}

https://learn.microsoft.com/en-us/dotnet/core/tools/global-json

Potentially related. My Pipelines on Azure failed today, running first time on 7.0.302 (for a project using Radzen.Blazor) with those errors:

##[error]C:\devOpsAgent\_work\1\s\Libraries\Radzen.Blazor\Microsoft.NET.Sdk.Razor.SourceGenerators\Microsoft.NET.Sdk.Razor.SourceGenerators.RazorSourceGenerator\RadzenDataGridCell_razor.g.cs(566,162): Error CS0307: The namespace '__Blazor.Radzen.Blazor.RadzenDataGridRow' cannot be used with type arguments
C:\devOpsAgent\_work\1\s\Libraries\Radzen.Blazor\Microsoft.NET.Sdk.Razor.SourceGenerators\Microsoft.NET.Sdk.Razor.SourceGenerators.RazorSourceGenerator\RadzenDataGridCell_razor.g.cs(566,162): error CS0307: The namespace '__Blazor.Radzen.Blazor.RadzenDataGridRow' cannot be used with type arguments [C:\devOpsAgent\_work\1\s\Libraries\Radzen.Blazor\Radzen.Blazor.csproj]
##[error]C:\devOpsAgent\_work\1\s\Libraries\Radzen.Blazor\Microsoft.NET.Sdk.Razor.SourceGenerators\Microsoft.NET.Sdk.Razor.SourceGenerators.RazorSourceGenerator\RadzenGrid_razor.g.cs(3323,158): Error CS0307: The namespace '__Blazor.Radzen.Blazor.RadzenGrid' cannot be used with type arguments
C:\devOpsAgent\_work\1\s\Libraries\Radzen.Blazor\Microsoft.NET.Sdk.Razor.SourceGenerators\Microsoft.NET.Sdk.Razor.SourceGenerators.RazorSourceGenerator\RadzenGrid_razor.g.cs(3323,158): error CS0307: The namespace '__Blazor.Radzen.Blazor.RadzenGrid' cannot be used with type arguments [C:\devOpsAgent\_work\1\s\Libraries\Radzen.Blazor\Radzen.Blazor.csproj]
##[error]C:\devOpsAgent\_work\1\s\Libraries\Radzen.Blazor\Microsoft.NET.Sdk.Razor.SourceGenerators\Microsoft.NET.Sdk.Razor.SourceGenerators.RazorSourceGenerator\RadzenDataGridRow_razor.g.cs(491,162): Error CS0307: The namespace '__Blazor.Radzen.Blazor.RadzenDataGridRow' cannot be used with type arguments

It was first time running it on this SDK version. I updated my SDK locally to 7.0.302 - project builds fine on my machine.

Thank you for the heads up @jjonescz ! Do you think there will be another .NET 7 SDK release that will include dotnet/aspnetcore#8614 and possibly a fix for the current issue? I will try to fix those issues in our code but it is good to know.

We expect so. Working on paperwork for reverting the change at the moment.

Recently it’s been common for visual studio upgrades to introduce razor bugs, with fixes delayed for a long time. For example, @bind:after was repeatedly broken. It seems like the cadence of integration is resulting in problems being found only after the various SDK builds come together, too late for the solutions to be merged - so the bug goes out into the wild.

Looks like the issue is related to passing ‘this’ in a blazor component to a subcomponent as well in my case… that’s where I’m having this pop up.

I’m having it in places without inheritance as well, so there seems to be a few major issues here haha