Reacting to Hosting changes

This commit is contained in:
Pranav K 2015-12-18 15:21:22 -08:00
parent aa7ebb343a
commit 7dac5c711b
30 changed files with 308 additions and 195 deletions

View File

@ -1,9 +1,7 @@
// Copyright (c) .NET Foundation. All rights reserved. // Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using Microsoft.AspNet.Builder; using Microsoft.AspNet.Builder;
using Microsoft.AspNet.Hosting;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
@ -12,11 +10,9 @@ namespace MvcSandbox
public class Startup public class Startup
{ {
// This method gets called by the runtime. Use this method to add services to the container. // This method gets called by the runtime. Use this method to add services to the container.
public IServiceProvider ConfigureServices(IServiceCollection services) public void ConfigureServices(IServiceCollection services)
{ {
services.AddMvc(); services.AddMvc();
return services.BuildServiceProvider();
} }
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.

View File

@ -16,6 +16,7 @@ using Microsoft.Extensions.PlatformAbstractions;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Logging.Testing; using Microsoft.Extensions.Logging.Testing;
using Microsoft.AspNet.Hosting.Internal;
namespace Microsoft.AspNet.Mvc.FunctionalTests namespace Microsoft.AspNet.Mvc.FunctionalTests
{ {
@ -41,33 +42,22 @@ namespace Microsoft.AspNet.Mvc.FunctionalTests
configureApplication = application => configureWithLogger(application, NullLoggerFactory.Instance); configureApplication = application => configureWithLogger(application, NullLoggerFactory.Instance);
} }
var buildServices = (Func<IServiceCollection, IServiceProvider>)startupTypeInfo var configureServices = (Action<IServiceCollection>)startupTypeInfo
.DeclaredMethods .DeclaredMethods
.FirstOrDefault(m => m.Name == "ConfigureServices" && m.ReturnType == typeof(IServiceProvider)) .First(m => m.Name == "ConfigureServices")
?.CreateDelegate(typeof(Func<IServiceCollection, IServiceProvider>), startupInstance); .CreateDelegate(typeof(Action<IServiceCollection>), startupInstance);
if (buildServices == null)
{
var configureServices = (Action<IServiceCollection>)startupTypeInfo
.DeclaredMethods
.FirstOrDefault(m => m.Name == "ConfigureServices" && m.ReturnType == typeof(void))
?.CreateDelegate(typeof(Action<IServiceCollection>), startupInstance);
Debug.Assert(configureServices != null);
buildServices = services =>
{
configureServices(services);
return services.BuildServiceProvider();
};
}
// RequestLocalizationOptions saves the current culture when constructed, potentially changing response // RequestLocalizationOptions saves the current culture when constructed, potentially changing response
// localization i.e. RequestLocalizationMiddleware behavior. Ensure the saved culture // localization i.e. RequestLocalizationMiddleware behavior. Ensure the saved culture
// (DefaultRequestCulture) is consistent regardless of system configuration or personal preferences. // (DefaultRequestCulture) is consistent regardless of system configuration or personal preferences.
using (new CultureReplacer()) using (new CultureReplacer())
{ {
_server = TestServer.Create( var builder = new WebApplicationBuilder()
configureApplication, .Configure(configureApplication)
configureServices: InitializeServices(startupTypeInfo.Assembly, buildServices)); .ConfigureServices(
services => InitializeServices(startupTypeInfo.Assembly, services, configureServices));
_server = new TestServer(builder);
} }
Client = _server.CreateClient(); Client = _server.CreateClient();
@ -86,9 +76,10 @@ namespace Microsoft.AspNet.Mvc.FunctionalTests
{ {
} }
private Func<IServiceCollection, IServiceProvider> InitializeServices( private void InitializeServices(
Assembly startupAssembly, Assembly startupAssembly,
Func<IServiceCollection, IServiceProvider> buildServices) IServiceCollection services,
Action<IServiceCollection> configureServices)
{ {
var libraryManager = PlatformServices.Default.LibraryManager; var libraryManager = PlatformServices.Default.LibraryManager;
@ -104,24 +95,24 @@ namespace Microsoft.AspNet.Mvc.FunctionalTests
var applicationEnvironment = PlatformServices.Default.Application; var applicationEnvironment = PlatformServices.Default.Application;
return (services) => services.AddSingleton<IApplicationEnvironment>(
new TestApplicationEnvironment(applicationEnvironment, applicationName, applicationRoot));
var hostingEnvironment = new HostingEnvironment();
hostingEnvironment.Initialize(applicationRoot, new WebApplicationOptions(), configuration: null);
services.AddSingleton<IHostingEnvironment>(hostingEnvironment);
// Inject a custom assembly provider. Overrides AddMvc() because that uses TryAdd().
var assemblyProvider = new StaticAssemblyProvider();
assemblyProvider.CandidateAssemblies.Add(startupAssembly);
services.AddSingleton<IAssemblyProvider>(assemblyProvider);
AddAdditionalServices(services);
if (configureServices != null)
{ {
services.AddSingleton<IApplicationEnvironment>( configureServices(services);
new TestApplicationEnvironment(applicationEnvironment, applicationName, applicationRoot)); }
var hostingEnvironment = new HostingEnvironment();
hostingEnvironment.Initialize(applicationRoot, new WebHostOptions(), configuration: null);
services.AddSingleton<IHostingEnvironment>(hostingEnvironment);
// Inject a custom assembly provider. Overrides AddMvc() because that uses TryAdd().
var assemblyProvider = new StaticAssemblyProvider();
assemblyProvider.CandidateAssemblies.Add(startupAssembly);
services.AddSingleton<IAssemblyProvider>(assemblyProvider);
AddAdditionalServices(services);
return buildServices(services);
};
} }
} }
} }

View File

@ -1,7 +1,6 @@
// Copyright (c) .NET Foundation. All rights reserved. // Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using System.Reflection; using System.Reflection;
using ControllersFromServicesClassLibrary; using ControllersFromServicesClassLibrary;
using Microsoft.AspNet.Builder; using Microsoft.AspNet.Builder;
@ -14,7 +13,7 @@ namespace ControllersFromServicesWebSite
{ {
public class Startup public class Startup
{ {
public IServiceProvider ConfigureServices(IServiceCollection services) public void ConfigureServices(IServiceCollection services)
{ {
services services
.AddMvc() .AddMvc()
@ -25,8 +24,6 @@ namespace ControllersFromServicesWebSite
services.AddTransient<QueryValueService>(); services.AddTransient<QueryValueService>();
services.AddSingleton<IHttpContextAccessor, HttpContextAccessor>(); services.AddSingleton<IHttpContextAccessor, HttpContextAccessor>();
return services.BuildServiceProvider();
} }
public void Configure(IApplicationBuilder app) public void Configure(IApplicationBuilder app)

View File

@ -3,6 +3,7 @@
using System.Reflection; using System.Reflection;
using Microsoft.AspNet.Builder; using Microsoft.AspNet.Builder;
using Microsoft.AspNet.Hosting;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
namespace PrecompilationWebSite namespace PrecompilationWebSite
@ -24,5 +25,15 @@ namespace PrecompilationWebSite
app.UseMvcWithDefaultRoute(); app.UseMvcWithDefaultRoute();
} }
public static void Main(string[] args)
{
var application = new WebApplicationBuilder()
.UseConfiguration(WebApplicationConfiguration.GetDefault(args))
.UseStartup<Startup>()
.Build();
application.Run();
}
} }
} }

View File

@ -0,0 +1,3 @@
{
"server": "Microsoft.AspNet.Server.Kestrel"
}

View File

@ -1,28 +1,31 @@
{ {
"commands": { "commands": {
"web": "Microsoft.AspNet.Hosting server=Microsoft.AspNet.Server.WebListener server.urls=http://localhost:5001", "web": "PrecompilationWebSite"
"kestrel": "Microsoft.AspNet.Hosting --server Microsoft.AspNet.Server.Kestrel --server.urls http://localhost:5000" },
"compilationOptions": {
"emitEntryPoint": true
},
"dependencies": {
"Microsoft.AspNet.Mvc": "6.0.0-*",
"Microsoft.AspNet.Mvc.TagHelpers": "6.0.0-*",
"Microsoft.AspNet.Mvc.TestConfiguration": "1.0.0",
"Microsoft.AspNet.Server.Kestrel": "1.0.0-*",
"Microsoft.AspNet.StaticFiles": "1.0.0-*",
"Microsoft.Extensions.PropertyHelper.Sources": {
"version": "1.0.0-*",
"type": "build"
}
},
"frameworks": {
"dnx451": {
"compilationOptions": {
"define": [ "CUSTOM_DNX451_DEFINE" ]
}
}, },
"dependencies": { "dnxcore50": {
"Microsoft.AspNet.Server.Kestrel": "1.0.0-*", "compilationOptions": {
"Microsoft.AspNet.Mvc": "6.0.0-*", "define": [ "CUSTOM_DNXCORE50_DEFINE" ]
"Microsoft.AspNet.Mvc.TagHelpers": "6.0.0-*", }
"Microsoft.AspNet.Mvc.TestConfiguration": "1.0.0", }
"Microsoft.AspNet.Server.WebListener": "1.0.0-*", }
"Microsoft.AspNet.StaticFiles": "1.0.0-*",
"Microsoft.Extensions.PropertyHelper.Sources": { "version": "1.0.0-*", "type": "build" }
},
"frameworks": {
"dnx451": {
"compilationOptions": {
"define": [ "CUSTOM_DNX451_DEFINE" ]
}
},
"dnxcore50": {
"compilationOptions": {
"define": [ "CUSTOM_DNXCORE50_DEFINE" ]
}
}
},
"webroot": "wwwroot"
} }

View File

@ -4,6 +4,7 @@
using System.Diagnostics; using System.Diagnostics;
using System.IO; using System.IO;
using Microsoft.AspNet.Builder; using Microsoft.AspNet.Builder;
using Microsoft.AspNet.Hosting;
using Microsoft.AspNet.Mvc.Razor.Compilation; using Microsoft.AspNet.Mvc.Razor.Compilation;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
@ -42,5 +43,15 @@ namespace RazorPageExecutionInstrumentationWebSite
// Add MVC to the request pipeline // Add MVC to the request pipeline
app.UseMvcWithDefaultRoute(); app.UseMvcWithDefaultRoute();
} }
public static void Main(string[] args)
{
var application = new WebApplicationBuilder()
.UseConfiguration(WebApplicationConfiguration.GetDefault(args))
.UseStartup<Startup>()
.Build();
application.Run();
}
} }
} }

View File

@ -0,0 +1,3 @@
{
"server": "Microsoft.AspNet.Server.Kestrel"
}

View File

@ -1,19 +1,19 @@
{ {
"compilationOptions": {
"emitEntryPoint": true
},
"commands": { "commands": {
"web": "Microsoft.AspNet.Hosting server=Microsoft.AspNet.Server.WebListener server.urls=http://localhost:5001", "web": "RazorPageExecutionInstrumentationWebSite"
"kestrel": "Microsoft.AspNet.Hosting --server Microsoft.AspNet.Server.Kestrel --server.urls http://localhost:5000"
}, },
"dependencies": { "dependencies": {
"Microsoft.AspNet.Mvc": "6.0.0-*", "Microsoft.AspNet.Mvc": "6.0.0-*",
"Microsoft.AspNet.Mvc.TestConfiguration": "1.0.0", "Microsoft.AspNet.Mvc.TestConfiguration": "1.0.0",
"Microsoft.AspNet.Server.Kestrel": "1.0.0-*", "Microsoft.AspNet.Server.Kestrel": "1.0.0-*",
"Microsoft.AspNet.Server.WebListener": "1.0.0-*",
"Microsoft.AspNet.StaticFiles": "1.0.0-*", "Microsoft.AspNet.StaticFiles": "1.0.0-*",
"Microsoft.Extensions.DiagnosticAdapter": "1.0.0-*" "Microsoft.Extensions.DiagnosticAdapter": "1.0.0-*"
}, },
"frameworks": { "frameworks": {
"dnx451": { }, "dnx451": { },
"dnxcore50": { } "dnxcore50": { }
}, }
"webroot": "wwwroot"
} }

View File

@ -4,6 +4,7 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Globalization; using System.Globalization;
using Microsoft.AspNet.Builder; using Microsoft.AspNet.Builder;
using Microsoft.AspNet.Hosting;
using Microsoft.AspNet.Localization; using Microsoft.AspNet.Localization;
using Microsoft.AspNet.Mvc.Razor; using Microsoft.AspNet.Mvc.Razor;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
@ -62,5 +63,15 @@ namespace RazorWebSite
app.UseMvcWithDefaultRoute(); app.UseMvcWithDefaultRoute();
} }
public static void Main(string[] args)
{
var application = new WebApplicationBuilder()
.UseConfiguration(WebApplicationConfiguration.GetDefault(args))
.UseStartup<Startup>()
.Build();
application.Run();
}
} }
} }

View File

@ -0,0 +1,3 @@
{
"server": "Microsoft.AspNet.Server.Kestrel"
}

View File

@ -1,28 +1,28 @@
{ {
"commands": { "commands": {
"web": "Microsoft.AspNet.Hosting server=Microsoft.AspNet.Server.WebListener server.urls=http://localhost:5001", "web": "RazorWebSite"
"kestrel": "Microsoft.AspNet.Hosting --server Microsoft.AspNet.Server.Kestrel --server.urls http://localhost:5000" },
"compilationOptions": {
"emitEntryPoint": true
},
"dependencies": {
"Microsoft.AspNet.Localization": "1.0.0-*",
"Microsoft.AspNet.Mvc": "6.0.0-*",
"Microsoft.AspNet.Mvc.Localization": "6.0.0-*",
"Microsoft.AspNet.Mvc.TestConfiguration": "1.0.0",
"Microsoft.AspNet.Server.Kestrel": "1.0.0-*",
"Microsoft.AspNet.StaticFiles": "1.0.0-*"
},
"frameworks": {
"dnx451": {
"compilationOptions": {
"define": [ "DNX451_CUSTOM_DEFINE" ]
}
}, },
"dependencies": { "dnxcore50": {
"Microsoft.AspNet.Server.Kestrel": "1.0.0-*", "compilationOptions": {
"Microsoft.AspNet.Localization": "1.0.0-*", "define": [ "DNXCORE50_CUSTOM_DEFINE" ]
"Microsoft.AspNet.Mvc": "6.0.0-*", }
"Microsoft.AspNet.Mvc.Localization": "6.0.0-*", }
"Microsoft.AspNet.Mvc.TestConfiguration": "1.0.0", }
"Microsoft.AspNet.Server.WebListener": "1.0.0-*",
"Microsoft.AspNet.StaticFiles": "1.0.0-*"
},
"frameworks": {
"dnx451": {
"compilationOptions": {
"define": [ "DNX451_CUSTOM_DEFINE" ]
}
},
"dnxcore50": {
"compilationOptions": {
"define": [ "DNXCORE50_CUSTOM_DEFINE" ]
}
}
},
"webroot": "wwwroot"
} }

View File

@ -2,6 +2,7 @@
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using Microsoft.AspNet.Builder; using Microsoft.AspNet.Builder;
using Microsoft.AspNet.Hosting;
using Microsoft.AspNet.Mvc.Infrastructure; using Microsoft.AspNet.Mvc.Infrastructure;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
@ -39,5 +40,15 @@ namespace RoutingWebSite
"{controller}/{action}/{path?}"); "{controller}/{action}/{path?}");
}); });
} }
public static void Main(string[] args)
{
var application = new WebApplicationBuilder()
.UseConfiguration(WebApplicationConfiguration.GetDefault(args))
.UseStartup<Startup>()
.Build();
application.Run();
}
} }
} }

View File

@ -0,0 +1,3 @@
{
"server": "Microsoft.AspNet.Server.Kestrel"
}

View File

@ -1,18 +1,18 @@
{ {
"commands": { "compilationOptions": {
"web": "Microsoft.AspNet.Hosting server=Microsoft.AspNet.Server.WebListener server.urls=http://localhost:5001", "emitEntryPoint": true
"kestrel": "Microsoft.AspNet.Hosting --server Microsoft.AspNet.Server.Kestrel --server.urls http://localhost:5000" },
}, "commands": {
"dependencies": { "web": "RoutingWebSite"
"Microsoft.AspNet.Server.Kestrel": "1.0.0-*", },
"Microsoft.AspNet.Mvc": "6.0.0-*", "dependencies": {
"Microsoft.AspNet.Mvc.TestConfiguration": "1.0.0", "Microsoft.AspNet.Mvc": "6.0.0-*",
"Microsoft.AspNet.Server.WebListener": "1.0.0-*", "Microsoft.AspNet.Mvc.TestConfiguration": "1.0.0",
"Microsoft.AspNet.StaticFiles": "1.0.0-*" "Microsoft.AspNet.Server.Kestrel": "1.0.0-*",
}, "Microsoft.AspNet.StaticFiles": "1.0.0-*"
"frameworks": { },
"dnx451": { }, "frameworks": {
"dnxcore50": { } "dnx451": { },
}, "dnxcore50": { }
"webroot": "wwwroot" }
} }

View File

@ -3,6 +3,7 @@
using System.Text.Encodings.Web; using System.Text.Encodings.Web;
using Microsoft.AspNet.Builder; using Microsoft.AspNet.Builder;
using Microsoft.AspNet.Hosting;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.WebEncoders.Testing; using Microsoft.Extensions.WebEncoders.Testing;
using Microsoft.Net.Http.Headers; using Microsoft.Net.Http.Headers;
@ -27,5 +28,15 @@ namespace SimpleWebSite
{ {
app.UseMvcWithDefaultRoute(); app.UseMvcWithDefaultRoute();
} }
public static void Main(string[] args)
{
var application = new WebApplicationBuilder()
.UseConfiguration(WebApplicationConfiguration.GetDefault(args))
.UseStartup<Startup>()
.Build();
application.Run();
}
} }
} }

View File

@ -0,0 +1,3 @@
{
"server": "Microsoft.AspNet.Server.Kestrel"
}

View File

@ -1,12 +1,13 @@
{ {
"compilationOptions": {
"emitEntryPoint": true
},
"commands": { "commands": {
"web": "Microsoft.AspNet.Server.Kestrel", "web": "SimpleWebSite"
"weblistener": "Microsoft.AspNet.Server.WebListener"
}, },
"dependencies": { "dependencies": {
"Microsoft.AspNet.Mvc": "6.0.0-*", "Microsoft.AspNet.Mvc": "6.0.0-*",
"Microsoft.AspNet.Server.Kestrel": "1.0.0-*", "Microsoft.AspNet.Server.Kestrel": "1.0.0-*"
"Microsoft.AspNet.Server.WebListener": "1.0.0-*"
}, },
"frameworks": { "frameworks": {
"dnx451": { }, "dnx451": { },

View File

@ -2,6 +2,7 @@
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using Microsoft.AspNet.Builder; using Microsoft.AspNet.Builder;
using Microsoft.AspNet.Hosting;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
namespace TagHelpersWebSite namespace TagHelpersWebSite
@ -20,5 +21,15 @@ namespace TagHelpersWebSite
app.UseMvcWithDefaultRoute(); app.UseMvcWithDefaultRoute();
} }
public static void Main(string[] args)
{
var application = new WebApplicationBuilder()
.UseConfiguration(WebApplicationConfiguration.GetDefault(args))
.UseStartup<Startup>()
.Build();
application.Run();
}
} }
} }

View File

@ -0,0 +1,3 @@
{
"server": "Microsoft.AspNet.Server.Kestrel"
}

View File

@ -1,19 +1,19 @@
{ {
"commands": { "compilationOptions": {
"web": "Microsoft.AspNet.Hosting server=Microsoft.AspNet.Server.WebListener server.urls=http://localhost:5001", "emitEntryPoint": true
"kestrel": "Microsoft.AspNet.Hosting --server Microsoft.AspNet.Server.Kestrel --server.urls http://localhost:5000" },
}, "commands": {
"dependencies": { "web": "TagHelpersWebSite"
"Microsoft.AspNet.Server.Kestrel": "1.0.0-*", },
"Microsoft.AspNet.Mvc": "6.0.0-*", "dependencies": {
"Microsoft.AspNet.Mvc.TagHelpers": "6.0.0-*", "Microsoft.AspNet.Mvc": "6.0.0-*",
"Microsoft.AspNet.Mvc.TestConfiguration": "1.0.0", "Microsoft.AspNet.Mvc.TagHelpers": "6.0.0-*",
"Microsoft.AspNet.Server.WebListener": "1.0.0-*", "Microsoft.AspNet.Mvc.TestConfiguration": "1.0.0",
"Microsoft.AspNet.StaticFiles": "1.0.0-*" "Microsoft.AspNet.Server.Kestrel": "1.0.0-*",
}, "Microsoft.AspNet.StaticFiles": "1.0.0-*"
"frameworks": { },
"dnx451": { }, "frameworks": {
"dnxcore50": { } "dnx451": { },
}, "dnxcore50": { }
"webroot": "wwwroot" }
} }

View File

@ -2,6 +2,7 @@
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using Microsoft.AspNet.Builder; using Microsoft.AspNet.Builder;
using Microsoft.AspNet.Hosting;
using Microsoft.AspNet.Mvc.Infrastructure; using Microsoft.AspNet.Mvc.Infrastructure;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
@ -24,5 +25,15 @@ namespace VersioningWebSite
app.UseMvcWithDefaultRoute(); app.UseMvcWithDefaultRoute();
} }
public static void Main(string[] args)
{
var application = new WebApplicationBuilder()
.UseConfiguration(WebApplicationConfiguration.GetDefault(args))
.UseStartup<Startup>()
.Build();
application.Run();
}
} }
} }

View File

@ -0,0 +1,3 @@
{
"server": "Microsoft.AspNet.Server.Kestrel"
}

View File

@ -1,18 +1,18 @@
{ {
"commands": { "compilationOptions": {
"web": "Microsoft.AspNet.Hosting server=Microsoft.AspNet.Server.WebListener server.urls=http://localhost:5001", "emitEntryPoint": true
"kestrel": "Microsoft.AspNet.Hosting --server Microsoft.AspNet.Server.Kestrel --server.urls http://localhost:5000" },
}, "commands": {
"dependencies": { "web": "VersioningWebSite"
"Microsoft.AspNet.Server.Kestrel": "1.0.0-*", },
"Microsoft.AspNet.Mvc": "6.0.0-*", "dependencies": {
"Microsoft.AspNet.Mvc.TestConfiguration": "1.0.0", "Microsoft.AspNet.Mvc": "6.0.0-*",
"Microsoft.AspNet.Server.WebListener": "1.0.0-*", "Microsoft.AspNet.Mvc.TestConfiguration": "1.0.0",
"Microsoft.AspNet.StaticFiles": "1.0.0-*" "Microsoft.AspNet.Server.Kestrel": "1.0.0-*",
}, "Microsoft.AspNet.StaticFiles": "1.0.0-*"
"frameworks": { },
"dnx451": { }, "frameworks": {
"dnxcore50": { } "dnx451": { },
}, "dnxcore50": { }
"webroot": "wwwroot" }
} }

View File

@ -2,7 +2,7 @@
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using Microsoft.AspNet.Builder; using Microsoft.AspNet.Builder;
using Microsoft.AspNet.Routing; using Microsoft.AspNet.Hosting;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
namespace WebApiCompatShimWebSite namespace WebApiCompatShimWebSite
@ -32,5 +32,15 @@ namespace WebApiCompatShimWebSite
routes.MapRoute("default", "{controller}/{action}/{id?}"); routes.MapRoute("default", "{controller}/{action}/{id?}");
}); });
} }
public static void Main(string[] args)
{
var application = new WebApplicationBuilder()
.UseConfiguration(WebApplicationConfiguration.GetDefault(args))
.UseStartup<Startup>()
.Build();
application.Run();
}
} }
} }

View File

@ -0,0 +1,3 @@
{
"server": "Microsoft.AspNet.Server.Kestrel"
}

View File

@ -1,19 +1,19 @@
{ {
"commands": { "compilationOptions": {
"web": "Microsoft.AspNet.Hosting server=Microsoft.AspNet.Server.WebListener server.urls=http://localhost:5001", "emitEntryPoint": true
"kestrel": "Microsoft.AspNet.Hosting --server Microsoft.AspNet.Server.Kestrel --server.urls http://localhost:5000" },
}, "commands": {
"dependencies": { "web": "WebApiCompatShimWebSite"
"Microsoft.AspNet.Server.Kestrel": "1.0.0-*", },
"Microsoft.AspNet.Mvc": "6.0.0-*", "dependencies": {
"Microsoft.AspNet.Mvc.TestConfiguration": "1.0.0", "Microsoft.AspNet.Mvc": "6.0.0-*",
"Microsoft.AspNet.Mvc.WebApiCompatShim": "6.0.0-*", "Microsoft.AspNet.Mvc.TestConfiguration": "1.0.0",
"Microsoft.AspNet.Server.WebListener": "1.0.0-*", "Microsoft.AspNet.Mvc.WebApiCompatShim": "6.0.0-*",
"Microsoft.AspNet.StaticFiles": "1.0.0-*" "Microsoft.AspNet.Server.Kestrel": "1.0.0-*",
}, "Microsoft.AspNet.StaticFiles": "1.0.0-*"
"frameworks": { },
"dnx451": { }, "frameworks": {
"dnxcore50": { } "dnx451": { },
}, "dnxcore50": { }
"webroot": "wwwroot" }
} }

View File

@ -2,6 +2,7 @@
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using Microsoft.AspNet.Builder; using Microsoft.AspNet.Builder;
using Microsoft.AspNet.Hosting;
using Microsoft.AspNet.Mvc; using Microsoft.AspNet.Mvc;
using Microsoft.AspNet.Mvc.Formatters; using Microsoft.AspNet.Mvc.Formatters;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
@ -75,5 +76,15 @@ namespace XmlFormattersWebSite
defaults: new { controller = "Home", action = "Index" }); defaults: new { controller = "Home", action = "Index" });
}); });
} }
public static void Main(string[] args)
{
var application = new WebApplicationBuilder()
.UseConfiguration(WebApplicationConfiguration.GetDefault(args))
.UseStartup<Startup>()
.Build();
application.Run();
}
} }
} }

View File

@ -0,0 +1,3 @@
{
"server": "Microsoft.AspNet.Server.Kestrel"
}

View File

@ -1,23 +1,23 @@
{ {
"commands": { "compilationOptions": {
"web": "Microsoft.AspNet.Hosting server=Microsoft.AspNet.Server.WebListener server.urls=http://localhost:5001", "emitEntryPoint": true
"kestrel": "Microsoft.AspNet.Hosting --server Microsoft.AspNet.Server.Kestrel --server.urls http://localhost:5000" },
}, "commands": {
"dependencies": { "web": "XmlFormattersWebSite"
"Microsoft.AspNet.Server.Kestrel": "1.0.0-*", },
"Microsoft.AspNet.Mvc": "6.0.0-*", "dependencies": {
"Microsoft.AspNet.Mvc.Formatters.Xml": "6.0.0-*", "Microsoft.AspNet.Mvc": "6.0.0-*",
"Microsoft.AspNet.Mvc.TestConfiguration": "1.0.0", "Microsoft.AspNet.Mvc.Formatters.Xml": "6.0.0-*",
"Microsoft.AspNet.Server.WebListener": "1.0.0-*", "Microsoft.AspNet.Mvc.TestConfiguration": "1.0.0",
"Microsoft.AspNet.StaticFiles": "1.0.0-*" "Microsoft.AspNet.Server.Kestrel": "1.0.0-*",
}, "Microsoft.AspNet.StaticFiles": "1.0.0-*"
"frameworks": { },
"dnx451": { }, "frameworks": {
"dnxcore50": { "dnx451": { },
"dependencies": { "dnxcore50": {
"System.Linq.Queryable": "4.0.1-*" "dependencies": {
} "System.Linq.Queryable": "4.0.1-*"
} }
}, }
"webroot": "wwwroot" }
} }