The name WebHost does not exists in current context
WebHost
class resides Microsoft.AspNetCore
assembly that comes with Microsoft.AspNetCore.All
NuGet package. So to fix you problem install this NuGet package and add following using
directive to your source file:
using Microsoft.AspNetCore;
As CodeFuller's answer indicated the WebHost
class is available in the assembly Microsoft.AspNetCore
If you don't need everything, you can just get the package Microsoft.AspNetCore
.