I was facing this issue in my Visual Studio 2017 15.7.2
version. The cause for this issue in my case was, unknowingly I had changed my Asp.Net Core 2.1
Web API project output type to Class Library
. Changing it back to Windows Application
fixed my issue.