AspNetCore.Docs/aspnet/fundamentals/static-files/sample/Program.cs

28 lines
751 B
C#
Raw Normal View History

using System.IO;
using System.Reflection;
2016-06-10 09:09:05 +08:00
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
2016-06-10 09:09:05 +08:00
namespace StaticFiles
2016-06-10 09:09:05 +08:00
{
public class Program
{
public static void Main(string[] args)
{
var builder = new ConfigurationBuilder()
.AddCommandLine(args)
.AddEnvironmentVariables();
2016-06-10 09:09:05 +08:00
var host = new WebHostBuilder()
.UseKestrel()
.UseContentRoot(Directory.GetCurrentDirectory())
.UseIISIntegration()
.UseStartup(typeof(Program).GetTypeInfo().Assembly.GetName().Name)
.UseConfiguration(builder.Build())
2016-06-10 09:09:05 +08:00
.Build();
host.Run();
}
}
}