Skip to content

The name "WebHost" does not exist #4787

@alessandroros

Description

@alessandroros

Describe the bug

I get the following error:
The name 'WebHost' does not exist in the current context. As I can see the WebHost

To Reproduce

I would like to create a WebApi project using .Net Core 2.2.0.
I'm using the scaffolded solution proposed from Visual Studio.

Program.cs (which I see is the same as the doc):

{
    public class Program
    {
        public static void Main(string[] args)
        {
            CreateWebHostBuilder(args).Build().Run();
        }

        public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
            WebHost.CreateDefaultBuilder(args)
                .UseStartup<Startup>();
    }
}

Throws the following error

image

VS Community 15.9.4
NetCore 2.2.101

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions