centos 部署 asp.net core Error -99 EADDRNOTAVAIL address not available解決

centos7.3上部署 asp.net core 錯誤以下:centos

1 Hosting environment: Production
2 Content root path: /home/netcore
3 Now listening on: http://localhost:5000
4 Application started. Press Ctrl+C to shut down.
5 warn: Microsoft.AspNetCore.Server.Kestrel[0]
6 Unable to bind to http://localhost:5000 on the IPv6 loopback interface: 'Error -99 EADDRNOTAVAIL address not available'.

 

解決辦法:asp.net

修改Program.cs文件指定運行urloop

 1 public class Program
 2     {
 3         public static void Main(string[] args)
 4         {
 5             BuildWebHost(args).Run();
 6         }
 7 
 8         public static IWebHost BuildWebHost(string[] args) =>
 9             WebHost.CreateDefaultBuilder(args)
10                 .UseStartup<Startup>()
11                 .UseUrls("http://*:8081") 12                 .Build();
13     }
相關文章
相關標籤/搜索