Radzen.Blazor build failures and components not rendering in Visual Studio 17.6 #853

Closed
opened 2026-01-29 17:45:18 +00:00 by claunia · 13 comments
Owner

Originally created by @blake-fm on GitHub (May 19, 2023).

Describe the bug
Radzen.Blazor fails build, and has other real cute silent failures, when using Visual Studio 17.6 (Release -- the old preview worked just fine). Releated to razor issue #8718.

To Reproduce
Steps to reproduce the behavior:

  1. Download source
  2. Build source with VS 17.6

Expected behavior
Source builds.

Workaround
I've added some comments on #8718 with my workarounds. Additionally, any components like tick.razor that have neither a .razor.cs file, nor anything other than a @code{} block, would simply not be called. No errors, no warnings - the code was simply never called.

I resolved the Tick part by turning tick.razor into tick.cs; something like:

public partial class Tick : ComponentBase {
    // Insert copy/pasta from tick.razor
}

Hope this helps.

Originally created by @blake-fm on GitHub (May 19, 2023). **Describe the bug** Radzen.Blazor fails build, and has other real cute silent failures, when using Visual Studio 17.6 (Release -- the old preview worked just fine). Releated to [razor issue #8718](https://github.com/dotnet/razor/issues/8718). **To Reproduce** Steps to reproduce the behavior: 1. Download source 2. Build source with VS 17.6 **Expected behavior** Source builds. **Workaround** I've added some comments on #8718 with my workarounds. Additionally, any components like `tick.razor` that have neither a `.razor.cs` file, nor anything other than a `@code{}` block, would simply _not be called_. No errors, no warnings - the code was simply never called. I resolved the `Tick` part by turning `tick.razor` into `tick.cs`; something like: ```C# public partial class Tick : ComponentBase { // Insert copy/pasta from tick.razor } ``` Hope this helps.
Author
Owner

@akorchev commented on GitHub (May 19, 2023):

Hi @blake-fm,

This definitely looks as a regression in the .NET SDK. It seems the Microsoft team is fixing this issue with https://github.com/dotnet/razor/pull/8721

This change caused all kinds of problems though so we will closely monitor the progress and act accordingly.

@akorchev commented on GitHub (May 19, 2023): Hi @blake-fm, This definitely looks as a regression in the .NET SDK. It seems the Microsoft team is fixing this issue with https://github.com/dotnet/razor/pull/8721 This change caused all kinds of problems though so we will closely monitor the progress and act accordingly.
Author
Owner

@blake-fm commented on GitHub (May 19, 2023):

It sure is. Though, with the suggested structure, I have zero build issues on a fairly large project. For now, it also includes the entire build for /Radzen.Blazor, with modifications.

@blake-fm commented on GitHub (May 19, 2023): It sure is. Though, with the [suggested structure](https://github.com/dotnet/razor/issues/8718#issuecomment-1553914035), I have zero build issues on a fairly large project. For now, it also includes the entire build for `/Radzen.Blazor`, with modifications.
Author
Owner

@akorchev commented on GitHub (May 19, 2023):

This would solve the build errors indeed. We have bigger issues with our other products though :( Hopefully we find a workaround.

@akorchev commented on GitHub (May 19, 2023): This would solve the build errors indeed. We have bigger issues with our other products though :( Hopefully we find a workaround.
Author
Owner

@blake-fm commented on GitHub (May 19, 2023):

Very sorry to hear! I've not seen the other products personally, but I do hope you guys are not forced to rollback and wait for too long.

@blake-fm commented on GitHub (May 19, 2023): Very sorry to hear! I've not seen the other products personally, but I do hope you guys are not forced to rollback and wait for too long.
Author
Owner

@akorchev commented on GitHub (May 19, 2023):

Hi again @blake-fm,

Would you mind opening a PR with the changes you have made? Or at least tell us what files you have changed.

I've made the project build by adding two .cs files - one for RadzenDataGridRow and one for RadzenGrid - but I may have missed something.

@akorchev commented on GitHub (May 19, 2023): Hi again @blake-fm, Would you mind opening a PR with the changes you have made? Or at least tell us what files you have changed. I've made the project build by adding two .cs files - one for RadzenDataGridRow and one for RadzenGrid - but I may have missed something.
Author
Owner

@blake-fm commented on GitHub (May 19, 2023):

Sadly I was forced into a temporary hard fork (time constraints), and had to stop planning PRs from my local branch. Reconciling back is not something I could achieve in a timely manner.

I saw you posted another @code{} only file, that had similar issues - those are the scary ones, what with the potential for almost entirely silent failures. Good thing nobody does access control in components.. I hope? But should be easy enough to regex find that one.

Beyond that, I haven't noticed any other types of silent failures - so if you're compiling, hopefully that's that. FYI I did also submit the Tick issue, as a separate issue (https://github.com/dotnet/razor/issues/8737).

@blake-fm commented on GitHub (May 19, 2023): Sadly I was forced into a temporary hard fork (time constraints), and had to stop planning PRs from my local branch. Reconciling back is not something I could achieve in a timely manner. I saw you posted another @code{} only file, that had similar issues - those are the scary ones, what with the potential for almost entirely silent failures. Good thing nobody does access control in components.. I hope? But should be easy enough to regex find that one. Beyond that, I haven't noticed any other _types_ of silent failures - so if you're compiling, hopefully that's that. FYI I did also submit the Tick issue, as a separate issue (https://github.com/dotnet/razor/issues/8737).
Author
Owner

@blake-fm commented on GitHub (May 19, 2023):

That felt like too much of a cop-out. So, here's some actual effort:

^(?<![\s\S\r])((\s|\n|\r)*@(using|typeparam|page|inherits|inplements).*)*(\s|\n|\r)*@code

Results:
image

Will put up an at least partial PR asap.

@blake-fm commented on GitHub (May 19, 2023): That felt like too much of a cop-out. So, here's some actual effort: ```regex ^(?<![\s\S\r])((\s|\n|\r)*@(using|typeparam|page|inherits|inplements).*)*(\s|\n|\r)*@code ``` Results: ![image](https://github.com/radzenhq/radzen-blazor/assets/89286531/ac6c7932-9af1-4c5f-9520-2545ceaec8e0) Will put up an at least partial PR asap.
Author
Owner

@akorchev commented on GitHub (May 19, 2023):

Thank you @blake-fm but you have done enough to help us already! I think I am done with the changes and will push a fix soon.

@akorchev commented on GitHub (May 19, 2023): Thank you @blake-fm but you have done enough to help us already! I think I am done with the changes and will push a fix soon.
Author
Owner

@akorchev commented on GitHub (May 19, 2023):

The commit was pushed: edf381c914

A Microsoft developer confirmed a new version of the .NET SDK would fix the regressions.

@akorchev commented on GitHub (May 19, 2023): The commit was pushed: https://github.com/radzenhq/radzen-blazor/commit/edf381c9142e136acaa337ed42a7a7e8f8be8e22 A Microsoft developer confirmed a new version of the .NET SDK would fix the regressions.
Author
Owner

@blake-fm commented on GitHub (May 19, 2023):

I'm sure you've tested thoroughly already, but I did a fresh clone and it built and ran just fine for me (very quick test though!).

@blake-fm commented on GitHub (May 19, 2023): I'm sure you've tested thoroughly already, but I did a fresh clone and it built and ran just fine for me (very quick test though!).
Author
Owner

@akorchev commented on GitHub (May 23, 2023):

Seems to be fine with the latest tree. May need the latest Visual Studio version in order to build with .NET 7.0.302.

@akorchev commented on GitHub (May 23, 2023): Seems to be fine with the latest tree. May need the latest Visual Studio version in order to build with .NET 7.0.302.
Author
Owner

@Varin6 commented on GitHub (May 23, 2023):

Potentially related. My Pipelines on Azure failed today 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 - builds on my machine.

@Varin6 commented on GitHub (May 23, 2023): Potentially related. My Pipelines on Azure failed today 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 - builds on my machine.
Author
Owner

@akorchev commented on GitHub (May 23, 2023):

Yes, it is the same error. Make sure to update the Radzen.Blazor source in your repo. It should be the latest one.

@akorchev commented on GitHub (May 23, 2023): Yes, it is the same error. Make sure to update the Radzen.Blazor source in your repo. It should be the latest one.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/radzen-blazor#853