As been mentioned in the comments, changing project Sdk to Microsoft.NET.Sdk.Web
, fixes the issue.
Also, if using Class Library
projects with Microsoft.NET.Sdk.Web
, there must be a Main method, to silence:
Error CS5001 : Program does not contain a static 'Main' method suitable for an entry point
Since it is required for Microsoft.NET.Sdk.Web
projects.