Skip to content

[Blazor] Errors in the startup project #16788

@Ratomir

Description

@Ratomir

Error in the startup project

I have errors, but still, I can compile and run the code without any issues.

To Reproduce

Steps to reproduce the behavior:

  1. Install ASP.NET core version, 3.1.0-preview1.19508.20
  2. Install the last update of Visual Studio, my version 16.4.0 Preview 2.0
  3. Create a new Blazor WebAssembly project with the latest Blazor project template in the empty solution
  4. Open the SurveyPrompt.razor page in the Shared folder of the new application
  5. You will see three types of errors
  • CS0111 Type 'SurveyPrompt' already defines a member called 'BuildRenderTree' with the same parameter types, Line 1

  • CS0102 The type 'SurveyPrompt' already contains a definition for 'Title' Line 15

  • CS0229 Ambiguity between 'SurveyPrompt.Title' and 'SurveyPrompt.Title'

Expected behavior

Open and see razor files without any issues and clear "Error List" tab of the Visual Studio

Screenshots

See the screenshot.
image
Here is the list of all nuget packages.
image

Additional context

If I open the compiled file in the background of the razor file and add a partial class keyword in the name of the class, errors will disappear.

This could be related to this feature, about partial class, https://devblogs.microsoft.com/aspnet/asp-net-core-updates-in-net-core-3-1-preview-1/

Thanks,
Ratomir

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-blazorIncludes: Blazor, Razor Components

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions