Skip to content

VS Community Preview 16.1.0 - Razor Components intellisense errors #9320

Closed
@aford22

Description

@aford22

Describe the bug

Regression with VS Community Preview 16.1.0 that was not present in previous Preview release. When authoring Razor Components the "Errors" window and Intellisense both show the same compilation "errors" that are not errors. The project still builds and runs despite those errors. See screenshot of error window:
image

These false compilation errors were not present in previous VS Community preview release.

To Reproduce

Steps to reproduce the behavior:

  1. Install VS Community Preview 16.1.0
  2. Use Razor Components "example" project that shipped with previous release of VS Community Preview (the project with the "Counter" page and "Fetch Data" weather forecasts page). I.e. the code:
@page "/counter"
@using WebApplication1.Services
@inject WeatherForecastService ForecastService

<h1>Counter</h1>
<p>Current count: @currentCount</p>
<button class="btn btn-primary" onclick="@IncrementCount">Click me</button>

@functions {
    int currentCount = 0;

    void IncrementCount()
    {
        currentCount++;
    }
}
  1. Build the project. You will see the false compilation errors
    image
  2. Project builds successfully and can be run with no issues

Expected behavior

False compilation errors should not be present in the "Errors" window nor as red wavy lines in the main "Code Editor" window

Additional context

These issues were not present in previous VS Community Preview release

Metadata

Metadata

Assignees

No one assigned

    Labels

    ✔️ Resolution: DuplicateResolved as a duplicate of another issueDoneThis issue has been fixedarea-blazorIncludes: Blazor, Razor Components

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions