Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Blazor regression in 7.0.302 SDK #8718

Closed
1 task done
ScarletKuro opened this issue May 16, 2023 · 74 comments
Closed
1 task done

Blazor regression in 7.0.302 SDK #8718

ScarletKuro opened this issue May 16, 2023 · 74 comments
Labels
area-blazor area-compiler Umbrella for all compiler issues bug Something isn't working
Milestone

Comments

@ScarletKuro
Copy link

ScarletKuro commented May 16, 2023

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 Blazor regression in 7.0.302 SDK #8718 (comment) for more information and avilable workaround.
  2. The attribute names could not be inferred from bind attribute (RZ9991):
    See Blazor wasm: RZ9991 build error when updating from 7.0.203 to 7.0.302 sdk #8725 (comment) 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 Blazor regression in 7.0.302 SDK #8718 (comment), 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 Blazor missing assembly reference with 7.0.302 #8729 (comment), 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: #8718 (comment).
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: #8718 (comment).
Additionally, don't forget to review other areas, such as GitHub workflows, or others CI/CD.

@sofiageo
Copy link

I have the same issue with .NET 8 preview 4 and my project.

@SpikeViper
Copy link

Having issues with 7.0.302 as well.
Getting
error CS0400: The type or namespace name 'InputComponent' could not be found in the global namespace (are you missing an assembly reference?)
But the imports are definitely there... and it works perfectly in previous versions. Not sure if related to this issue, but certainly related to the same version change.

@c4l3b
Copy link

c4l3b commented May 16, 2023

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.

@SpikeViper
Copy link

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.

@c4l3b
Copy link

c4l3b commented May 16, 2023

Yes! The issue that I can't resolve right now involves an inherited component with a render fragment. The consumer cannot resolve context in the render fragment

@ScarletKuro
Copy link
Author

The consumer cannot resolve context in the render fragment

I think we have this issue as well.

@c4l3b
Copy link

c4l3b commented May 16, 2023

I was going down the rabbit hole of trying to fix it, but I think I'm going to lock the version to 7.0.202 in my global.json file and wait and see if Microsoft issues a fix. Sounds like some unintended breaking changes...

@SpikeViper
Copy link

SpikeViper commented May 16, 2023

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

@javiercn javiercn transferred this issue from dotnet/aspnetcore May 17, 2023
@ghost ghost added the untriaged label May 17, 2023
@davidwengier davidwengier added the area-compiler Umbrella for all compiler issues label May 17, 2023
@davidwengier
Copy link
Contributor

fyi @dotnet/razor-compiler

@ScarletKuro
Copy link
Author

ScarletKuro commented May 17, 2023

We also digged the .g.cs files and found things like this

#line 158 "C:\Users\Riley\source\repos\MudBlazor\src\MudBlazor\Components\DataGrid\MudDataGrid.razor"
                                                                                        rowStyle

#line default
#line hidden
#nullable disable
            ) + "mud-table-row");
            __builder.OpenElement(125, "td");
            __builder.AddAttribute(126, "class", "mud-table-cell");
            __builder.AddAttribute(127, "colspan", "1000");
#nullable restore

notice the ( is flipped
Line 158:

<tr class="mud-table-row @rowClass" Style="@rowStyle" @key="item" @onclick="@((args) => OnRowClickedAsync(args, item, tmpRowIndex))">

#nullable disable
            __builder.OpenElement(171, "div");
            __builder.AddAttribute(172, "class", (
#nullable restore
#line 38 "C:\Users\Riley\source\repos\MudBlazor\src\MudBlazor\Components\DataGrid\MudDataGrid.razor"
                                           _tableClass

#line default
#line hidden
#nullable disable
#nullable restore
#line 38 "C:\Users\Riley\source\repos\MudBlazor\src\MudBlazor\Components\DataGrid\MudDataGrid.razor"
                                                                _tableStyle

#line default
#line hidden
#nullable disable
            ) + "mud-table-pagination");
#nullable restore

this one is missing a comma (Line 38 in source)

@jjonescz
Copy link
Contributor

jjonescz commented May 17, 2023

Seems this is another regression introduced by #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

@tn-5
Copy link

tn-5 commented May 17, 2023

I'm experiencing a similar issue with inheritance. We defined library components as follows:

  • Define a base component in a razor file
  • Define derived components in the same project using code (in a .cs file, no razor file). These derived components basically just set some standard properties on the base component (in this case it is for different button types, so it sets some standard text / icons).

The above works fine, except where we reference the derived component in the same project in a razor file. The same error message as noted above is then shown.

If we use the derived components in a different project which references the library project it also works fine.

Needless to say, this scenario worked 100% with preview 3.

@ScarletKuro
Copy link
Author

ScarletKuro commented May 17, 2023

(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.

@ScarletKuro
Copy link
Author

ScarletKuro commented May 18, 2023

As this issue pertains to broader problems with the new SDK, I would like to compile a list of all the related issues that have been created. Here are the GitHub issues that have been raised regarding the new SDK:

  1. Razor compilation fails after upgrading from VS 17.5.x to 17.6.0: warning RZ10012, error RZ9991, error CS1660, error CS1662 #8731
  2. 17.6 CS0029 Cannot implicitly convert type 'Microsoft.AspNetCore.Components.ElementReference' to '[class name]' #8727
  3. Blazor missing assembly reference with 7.0.302 #8729
  4. RZ10020 error after upgrading to Visual Studio 17.6 #8723
  5. Multiple components use the tag 'componentName'. on the same component #8724
  6. Blazor wasm: RZ9991 build error when updating from 7.0.203 to 7.0.302 sdk #8725
  7. RZ10012 warning and MSBuild 17.6 aspnetcore#48281
  8. Component never constructed, no build errors or exceptions #8737
  9. CS0029 - @ref causes compilation error see #17416 docs#35449
  10. Blazor - Cannot implicitly convert type 'Microsoft.AspNetCore.Components.ElementReference' when upgraded to VS 17.6.0 aspnetcore#48327
  11. Error RZ9991 since VS 17.6 upgrade #8753
  12. Compile time error "The attribute names could not be inferred from bind attribute..." when child page inherits from base #8755
  13. Blazor error: Cannot implicitly convert type 'Microsoft.AspNetCore.Components.ElementReference' to MyComponent  #8761
  14. Problem with CodeBehind PartialClass and inheritance. #8773
  15. A Blazor component that has inherited from another Blazor component, when used is interpreted as bare html aspnetcore#48496
  16. Component inheritance seems to be broken aspnetcore#48447
  17. Blazor using @inherits breaks Component ("Found markup element with unexpected name"). #8800
  18. I got a bug where I can't read custom classes in Razor Page. aspnetcore#48576
  19. Razor Compiler SDK 7.0.302 bug #8822

@blake-fm
Copy link

blake-fm commented May 19, 2023

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.

@danroth27
Copy link
Member

danroth27 commented Jun 8, 2023

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.

@danroth27
Copy link
Member

We've also been waiting patiently on "Pause and resume Blazor Server circuits (#30344)" for Blazor Server

@tedsmorris Please direct Pause and Resume related feedback to the corresponding GitHub issue as it isn't related to this Razor compiler regression. I can assure you we are still investing in Blazor Server as an integral part of our .NET web UI offering including supporting it as part of our full stack web UI support in .NET 8, which we think will mitigate some of the issues associated with long running circuits. We do expect to address Pause and Resume support as well in the future.

@jaredpar
Copy link
Member

jaredpar commented Jun 8, 2023

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.

@paulguz-datapa
Copy link

paulguz-datapa commented Jun 9, 2023

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.

@333fred
Copy link
Member

333fred commented Jun 13, 2023

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.

@333fred 333fred closed this as completed Jun 13, 2023
@RikkiGibson
Copy link
Contributor

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.

@wrharper-AASP
Copy link

I would like Microsoft to note that this issue happened somewhere between 17.5.5 & 17.6.2 because it worked for me in 17.5.5.

@sofiageo
Copy link

This is still broken for .NET 8 Preview 5

@max-motatos
Copy link

max-motatos commented Jun 14, 2023

Still broken in azure devops pipeline on ubuntu, when will you update the vm?

@max-motatos
Copy link

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.

I tried Microsoft.Net.Compilers.Razor.Toolset 7.0.0-preview.23312.9 but it is not working

@max-motatos
Copy link

For anyone else stuck with a broken CI, adding this task works:

- task: UseDotNet@2
  displayName: Install .NET Core 7 SDK
  inputs:
    packageType: 'sdk'
    version: '7.0.304'

@jjonescz
Copy link
Contributor

This is still broken for .NET 8 Preview 5

It should work in later previews (e.g., main from https://github.com/dotnet/installer#table).

I tried Microsoft.Net.Compilers.Razor.Toolset 7.0.0-preview.23312.9 but it is not working

Perhaps try newer version? I just tried with the broken .NET 8 Preview 5, and after installing toolset 7.0.0-preview.23313.3, the error goes away.

@rogerbriggen
Copy link

This is still broken for .NET 8 Preview 5

Same here (and it is very anyoing since MAUI only fixes bugs in the dotnet 8 and now this bugs prevent us from using Preview 5 for our solution)

@rogerbriggen
Copy link

This is still broken for .NET 8 Preview 5

It should work in later previews (e.g., main from https://github.com/dotnet/installer#table).

I tried Microsoft.Net.Compilers.Razor.Toolset 7.0.0-preview.23312.9 but it is not working

Perhaps try newer version? I just tried with the broken .NET 8 Preview 5, and after installing toolset 7.0.0-preview.23313.3, the error goes away.

That is not that simply... now it complains about workload wasi-experimental which cannot be installed because of missing dependencies in the azure nuget feed....

@jjonescz
Copy link
Contributor

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.

@Dona278
Copy link

Dona278 commented Jun 15, 2023

I confirm that the issue is still present in dotnet8-preview.5 and that it was fixed in both Package Source Mapping and Preview 6 from https://github.com/dotnet/installer#table.

@wrharper-AASP
Copy link

Just got the update and tested 17.6.3 after fixing some project settings for my case. It is working now.
Preview version is still not working though, but it is a different issue than this. However, I am using 6 and not 7 or 8.

@ScarletKuro
Copy link
Author

Just got the update and tested 17.6.3 after fixing some project settings for my case. It is working now. Preview version is still not working though, but it is a different issue than this. However, I am using 6 and not 7 or 8.

From my side, I can confirm that the issue with .NET 7 is resolved with SDK version 7.0.304. However, I cannot provide any insights regarding .NET 8 Preview 5. Regarding .NET 6, it seems that there are some changes that have not been backported, such as the one mentioned here: #8770. In my opinion, it would be better for people to create separate issues specifically for .NET 6 or .NET 8, as this particular issue is focused on the 7.0.302 SDK.

@wrharper-AASP
Copy link

Normally that would be true, in this case it looked like everyone had the issue until the update and now it's just .Net 8 Preview version, so it is probably a different issue at this point.

@sofiageo
Copy link

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

I also confirm that this workaround works for my project and .NET 8 preview 5. Just have to remember to remove it on the next preview update :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-blazor area-compiler Umbrella for all compiler issues bug Something isn't working
Projects
None yet