Upgrading to beta5
parent
b5eeae2451
commit
7028446322
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"projects": [ "src", "test" ],
|
||||
"sdk": {
|
||||
"version": "1.0.0-beta4"
|
||||
"version": "1.0.0-beta5"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNet.Hosting;
|
||||
using Microsoft.Framework.ConfigurationModel;
|
||||
using Microsoft.Framework.Configuration;
|
||||
|
||||
namespace ServersDemo
|
||||
{
|
||||
|
@ -11,20 +11,23 @@ namespace ServersDemo
|
|||
/// </summary>
|
||||
public class Program
|
||||
{
|
||||
private readonly IServiceProvider _serviceProvider;
|
||||
|
||||
public Program(IServiceProvider serviceProvider)
|
||||
{
|
||||
_serviceProvider = serviceProvider;
|
||||
}
|
||||
public Task<int> Main(string[] args)
|
||||
{
|
||||
//Add command line configuration source to read command line parameters.
|
||||
var config = new Configuration();
|
||||
config.AddCommandLine(args);
|
||||
var builder = new ConfigurationBuilder();
|
||||
builder.AddCommandLine(args);
|
||||
var config = builder.Build();
|
||||
|
||||
var context = new HostingContext()
|
||||
{
|
||||
Configuration = config,
|
||||
ServerFactoryLocation = "Microsoft.AspNet.Server.WebListener",
|
||||
ApplicationName = "ServersDemo"
|
||||
};
|
||||
|
||||
using (new HostingEngine().Start(context))
|
||||
using (new WebHostBuilder(_serviceProvider, config)
|
||||
.UseServer("Microsoft.AspNet.Server.WebListener")
|
||||
.Build()
|
||||
.Start())
|
||||
{
|
||||
Console.WriteLine("Started the server..");
|
||||
Console.WriteLine("Press any key to stop the server");
|
||||
|
|
|
@ -1,12 +1,23 @@
|
|||
using Microsoft.AspNet.Builder;
|
||||
using Microsoft.AspNet.Hosting;
|
||||
using Microsoft.AspNet.Http;
|
||||
using Microsoft.Framework.Configuration;
|
||||
using Microsoft.Framework.DependencyInjection;
|
||||
using Microsoft.Framework.Runtime;
|
||||
|
||||
namespace ServersDemo
|
||||
{
|
||||
public class Startup
|
||||
{
|
||||
// For more information on how to configure your application, visit http://go.microsoft.com/fwlink/?LinkID=398940
|
||||
public Startup(IHostingEnvironment env, IApplicationEnvironment appEnv)
|
||||
{
|
||||
// Setup configuration sources.
|
||||
var builder = new ConfigurationBuilder(appEnv.ApplicationBasePath)
|
||||
.AddJsonFile("config.json")
|
||||
.AddEnvironmentVariables();
|
||||
Configuration = builder.Build();
|
||||
}
|
||||
public IConfiguration Configuration { get; private set; }
|
||||
public void ConfigureServices(IServiceCollection services)
|
||||
{
|
||||
}
|
||||
|
|
|
@ -3,17 +3,17 @@
|
|||
"version": "1.0.0-*",
|
||||
|
||||
"dependencies": {
|
||||
"Microsoft.AspNet.Hosting.Interfaces": "1.0.0-beta4",
|
||||
"Microsoft.AspNet.Server.IIS": "1.0.0-beta4",
|
||||
"Microsoft.Framework.ConfigurationModel": "1.0.0-beta4",
|
||||
"Microsoft.AspNet.Server.WebListener": "1.0.0-beta4",
|
||||
"Kestrel": "1.0.0-beta4"
|
||||
"Microsoft.AspNet.Server.IIS": "1.0.0-beta5",
|
||||
"Microsoft.AspNet.Server.WebListener": "1.0.0-beta5",
|
||||
"Microsoft.Framework.Configuration.Json": "1.0.0-beta5",
|
||||
"Kestrel": "1.0.0-beta5"
|
||||
},
|
||||
|
||||
"commands": {
|
||||
"kestrel": "Microsoft.AspNet.Hosting --server Kestrel --server.urls http://localhost:5004",
|
||||
"run": "run server.urls=http://localhost:5003",
|
||||
"web": "Microsoft.AspNet.Hosting --server Microsoft.AspNet.Server.WebListener --server.urls http://localhost:5000"
|
||||
"web": "Microsoft.AspNet.Hosting --server Microsoft.AspNet.Server.WebListener --server.urls http://localhost:5000",
|
||||
"kestrel2": "Microsoft.AspNet.Hosting --server Kestrel"
|
||||
},
|
||||
|
||||
"frameworks": {
|
||||
|
|
Loading…
Reference in New Issue