make sure it is <Project Sdk="Microsoft.NET.Sdk.Web"> in csproj file and reload the project
<Project Sdk="Microsoft.NET.Sdk.Web">