Skip to content

Stamo-Gochev/blazor-type-issue

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

blazor-type-issue

Related to https://github.com/dotnet/aspnetcore/issues/37871

Describe the bug

Blazor wasm project reports an incorrect variable type. The type is correctly reported for blazor server (.NET 5.0 and .NET 6.0) as well as blazor wasm .NET 5.0 apps, but not for blazor wasm .NET 6.0 project.

To Reproduce

A repository that reproduces the issue can be found at: https://github.com/Stamo-Gochev/blazor-type-issue

It contains a component in a razor class library that is used by all project types to compare the output.

The component uses a generic argument for its Data parameter and checks if the type of it is contained in a list of predefined types and renders the result.

Steps to reproduce:

  1. Clone the repo
  2. Run the BlazorWasmAppNet60 project
  3. Open the Index.razor page and observe its output.

Note: The repo also contains tests projects for blazor server .NET 5.0 and .NET 6.0 apps as well as a blazor wasm .NET 5.0 app. You can use them to compare the output by looking at their /Pages/Index.razor file.

Expected behavior

The Index.razor page is expected to print:

BlazorWasmAppNet60 item has predefined type: True

This is also the output for all other project types - blazor server .NET 5.0, blazor server .NET 6.0 and blazor wasm .NET 5.0.

BlazorServerAppNet50 item has predefined type: True

BlazorServerAppNet60 item has predefined type: True

BlazorWasmAppNet50 item has predefined type: True

Actual behavior

The Index.razor page returns:

BlazorWasmAppNet60 item has predefined type: False <- this should be True as in all other projects

Further technical details

  • ASP.NET Core version - .NET 6.0 RC 2
  • Visual Studio 2022 Preview 7
  • Include the output of dotnet --info:

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published