把Program.cs加一行UseUrls代码如下:

using System.IO;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Builder;

namespace HelloMvc
{
    public class Program
    {
        public static void Main(string[] args)
        {
            var host = new WebHostBuilder()
                        .UseKestrel()
                        .UseContentRoot(Directory.GetCurrentDirectory())
                        .UseDefaultHostingConfiguration(args)
                        .UseIIS()
                        .UseStartup<Startup>()
                        .UseUrls("http://*:8888")
                        .Build();


            host.Run();
        }
    }
}

  

相关文章:

  • 2021-09-02
  • 2021-12-08
  • 2022-12-23
  • 2022-12-23
  • 2021-11-28
  • 2021-12-11
  • 2021-09-16
  • 2022-12-23
猜你喜欢
  • 2022-03-08
  • 2021-05-01
  • 2022-12-23
  • 2022-12-23
  • 2021-12-30
  • 2021-08-13
  • 2021-11-09
相关资源
相似解决方案