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:

These false compilation errors were not present in previous VS Community preview release.
Steps to reproduce the behavior:
@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++;
}
}

False compilation errors should not be present in the "Errors" window nor as red wavy lines in the main "Code Editor" window
These issues were not present in previous VS Community Preview release
@aford22 a few questions to properly diagnose what you're seeing.
dotnet --info output?Counter.razor as purple?.csprojWell, unfortunately the "Razor Components" project template has disappeared from the latest VS Comm release... as have the Blazor project templates. This is a problem in itself.
However if I use the "ASP.Net Core Web Application" template then "Web Application" to create a new project, there are lots of files that then need changed to make them work with Razor Components. Like Startup, index, .csproj, etc. Its hacking the whole newly generated project so much that I am not sure what this proves...
.NET Core SDK (reflecting any global.json):
Version: 3.0.100-preview3-010431
Commit: d72abce213
Runtime Environment:
OS Name: Windows
OS Version: 10.0.17763
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\3.0.100-preview3-010431\
Host (useful for support):
Version: 3.0.0-preview3-27503-5
Commit: 3844df9537
.NET Core SDKs installed:
2.1.500 [C:\Program Files\dotnet\sdk]
2.1.502 [C:\Program Files\dotnet\sdk]
2.1.503 [C:\Program Files\dotnet\sdk]
2.1.504 [C:\Program Files\dotnet\sdk]
2.1.505 [C:\Program Files\dotnet\sdk]
2.1.602 [C:\Program Files\dotnet\sdk]
2.1.700-preview-009597 [C:\Program Files\dotnet\sdk]
2.2.101 [C:\Program Files\dotnet\sdk]
3.0.100-preview3-010431 [C:\Program Files\dotnet\sdk]
.NET Core runtimes installed:
Microsoft.AspNetCore.All 2.1.6 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.1.7 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.1.8 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.1.9 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.2.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.App 2.1.6 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.1.7 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.1.8 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.1.9 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.2.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.0.0-preview3-19153-02 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 2.1.6 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.1.7 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.1.8 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.1.9 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.2.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 3.0.0-preview3-27503-5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 3.0.0-preview3-27504-2 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
No, its blue. See screenshot.

You can also see the false error red wavy line...
Surely:
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>netcoreapp3.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="3.0.0-preview3-19153-02" />
</ItemGroup>
</Project>
I'm having the same issue with SDK v3.0.100-preview3-010431 and VS 16.1 Preview 1. I can reproduce it by creating a new Razor Components project with dotnet new razorcomponents and opening it in Visual Studio. I receive errors such as:
CS0428 Cannot convert method group 'IncrementCount' to non-delegate type 'object'. Did you intend to invoke the method? C:\tmp\razorcomponents\Components\Pages\Counter.razor:7
Also the HTML tags don't get their correct colorization:

The csproj looks like this:
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>netcoreapp3.0</TargetFramework>
<LangVersion>7.3</LangVersion>
<_RazorComponentInclude>Components\**\*.cshtml</_RazorComponentInclude>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Components.Server" Version="3.0.0-preview3-19153-02" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="3.0.0-preview3-19153-02" />
</ItemGroup>
</Project>
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.
@mkArtakMSFT Any idea when the release that fixes this will come out?
Updating to Preview 4 fixed this for me, using the same VS 16.1 Preview 1 version.
@henkmollema oh I see. I'm having the same issue with VS 16.0.2 (public release) running core preview 4. Guess they fixed it in VS 16.1. I'll probably just deal with it until 16.1 goes public.
I would like to reopen this issue, as this is present also in 3.0.100-preview5-011568. If I clone this repo:
https://github.com/torhovland/blazor-realworld-example-app
and replace the version of core in global.json with "3.0.100-preview5-011568", the exact behaviour as above appears:
Im running VS2019 Preview, v 16.2.0 Preview 1.0
Here is my dotnet --info:
C:\Users\wagge>dotnet --info
.NET Core SDK (reflecting any global.json):
Version: 3.0.100-preview5-011568
Commit: b487ff10aaRuntime Environment:
OS Name: Windows
OS Version: 10.0.18362
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\3.0.100-preview5-011568\Host (useful for support):
Version: 3.0.0-preview5-27626-15
Commit: 61f30f5a23.NET Core SDKs installed:
2.1.507 [C:\Program Files\dotnet\sdk]
2.1.700 [C:\Program Files\dotnet\sdk]
2.1.800-preview-009677 [C:\Program Files\dotnet\sdk]
2.2.300 [C:\Program Files\dotnet\sdk]
2.2.400-preview-010195 [C:\Program Files\dotnet\sdk]
3.0.100-preview5-011568 [C:\Program Files\dotnet\sdk].NET Core runtimes installed:
Microsoft.AspNetCore.All 2.1.11 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.2.5 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.App 2.1.11 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.2.5 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.0.0-preview5-19227-01 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 2.1.11 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.2.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 3.0.0-preview5-27626-15 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 3.0.0-preview5-27626-15 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]To install additional .NET Core runtimes or SDKs:
https://aka.ms/dotnet-download
Hi, it looks like you are posting on a closed issue/PR/commit!
We're very likely to lose track of your bug/feedback/question unless you:
Thanks!
INdeed, i thought it would be good to re-open an issue that wasnt really resolved, but I can create a new one of course =)
Same error on 3.0.100-preview6-012264 / Razor.VSCode.
Should be reopened
Hi, it looks like you are posting on a closed issue/PR/commit!
We're very likely to lose track of your bug/feedback/question unless you:
Thanks!
Most helpful comment
Updating to Preview 4 fixed this for me, using the same VS 16.1 Preview 1 version.