Cannot run asp.net 5 from docker

前端 未结 4 428
清酒与你
清酒与你 2020-12-17 01:47

I have followed the following guide: Running ASP.NET 5 applications in Linux Containers with Docker and I cannot get this to work on my Windows PC or Linux server. My docker

4条回答
  •  借酒劲吻你
    2020-12-17 02:01

    For anyone having this issue now in RC2, commands no longer exists. You have to update Program.cs by chaining in .UseUrls("http://0.0.0.0:5000"). You can also change from 5000 to whatever your desired port is here.

    public class Program
    {
        public static void Main(string[] args)
        {
            var host = new WebHostBuilder()
                .UseKestrel()
                .UseContentRoot(Directory.GetCurrentDirectory())
                .UseIISIntegration()
                .UseStartup()
                .UseUrls("http://0.0.0.0:5000")
                .Build();
    
            host.Run();
        }
    }
    

提交回复
热议问题