Skip to content

Instantly share code, notes, and snippets.

@chenxizhang
Last active September 17, 2017 01:35
Show Gist options
  • Save chenxizhang/86a2f2f458fe10d916a54804e19bba82 to your computer and use it in GitHub Desktop.
Save chenxizhang/86a2f2f458fe10d916a54804e19bba82 to your computer and use it in GitHub Desktop.
ASP.NET Core的基本写法,自定义端口号
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Hosting;
namespace web
{
public class Program
{
public static void Main(string[] args)
{
var host = new WebHostBuilder()
.UseKestrel()
.UseContentRoot(Directory.GetCurrentDirectory())
.UseIISIntegration()
.UseStartup<Startup>()
.UseUrls("http://*:5000/")
.Build();
host.Run();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment