Base solution for your next web application
Open Closed

Latest asp.net core & angular #9145


User avatar
0
Siyeza created

I am trying to run the web.host project using the dotnet core command as above. My issue I am getting that 0.0.0.0:port - instead of localhost:port.

Do you guys know how can I do this?


2 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team

    hi

    Try UseUrls("https://localhost:44301")

            public static IWebHostBuilder CreateWebHostBuilder(string[] args)
            {
                return new WebHostBuilder()
                    .UseKestrel(opt =>
                    {
                        opt.AddServerHeader = false;
                        opt.Limits.MaxRequestLineSize = 16 * 1024;
                    })
                    .UseContentRoot(Directory.GetCurrentDirectory())
                    .UseUrls("https://localhost:44301")
                    .UseIIS()
                    .UseIISIntegration()
                    .UseStartup<Startup>();
            }
    
  • User Avatar
    0
    Siyeza created

    Thank you, this helped. I had tried it before maybe I was doing something else wrong. Thanks again.