I'm playing with a new record feature in a console app. I'm using my VS Community 16.8.0 + R# 2020.2.4 trial.
C# code
using System;
namespace ConsoleApp2
{
class Program
{
static void Main(string[] args)
{
var test = new Person("firstname", "lastname");
Console.WriteLine($"test.FirstName: {test.FirstName} test.LastName: {test.LastName}");
}
}
public record Person(string FirstName, string LastName);
}
Csproj file
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net5.0</TargetFramework>
</PropertyGroup>
</Project>
The code could be compiled and it runs.
Problem
The thing is that IntelliSense does not recognise the record itself. VS underlines the record definition and does not recognise its use despite the fact that the program itself can be compiled.
What am I doing wrong?
Note
VS somehow recognise a typo in record definition/use.


