question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

VS Community Preview 16.1.0 - Razor Components intellisense errors

See original GitHub issue

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

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:12 (6 by maintainers)

github_iconTop GitHub Comments

3reactions
henkmollemacommented, Apr 23, 2019

Updating to Preview 4 fixed this for me, using the same VS 16.1 Preview 1 version.

3reactions
mkArtakMSFTcommented, Apr 15, 2019

Thanks for contacting us folks. We believe this is now fix in our nightly releases and will be released as part of the next preview release.

Read more comments on GitHub >

github_iconTop Results From Across the Web

VS Community Preview 16.1.0 - Razor Components ...
VS Community Preview 16.1.0 - Razor Components intellisense errors ... When authoring Razor Components the "Errors" window and Intellisense ...
Read more >
Razor Intellisense Issues In VS 2019 (v16.1.6 & .net core ...
Hi,. I have a clean install of VS 2019 (16.1.6) and am using .net core 3 Preview 7, when i create a standard...
Read more >
Blazor and Visual Studio's Intellisense
When I open my Blazor solution in Visual Studio, Intellisense will show false errors for references to Blazor components, and will successfully ...
Read more >
Visual Studio 2019 version 16.1 Release Notes
Get the latest features, bug fixes, and support for Visual Studio 2019 v16.1. Download today.
Read more >
Reference and Intellisense problems with Blazor projects ...
TL;DR: when working on a Blazor project in VS 2022 I get random errors where references to namespaces and components don't work and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found