diff --git a/samples/MvcSandbox/Startup.cs b/samples/MvcSandbox/Startup.cs index 0e10082e22..8eb5cc6f16 100644 --- a/samples/MvcSandbox/Startup.cs +++ b/samples/MvcSandbox/Startup.cs @@ -1,9 +1,7 @@ // 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. -using System; using Microsoft.AspNet.Builder; -using Microsoft.AspNet.Hosting; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; @@ -12,11 +10,9 @@ namespace MvcSandbox public class Startup { // 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(); - - return services.BuildServiceProvider(); } // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. diff --git a/test/Microsoft.AspNet.Mvc.FunctionalTests/MvcTestFixture.cs b/test/Microsoft.AspNet.Mvc.FunctionalTests/MvcTestFixture.cs index 703f00e61c..dc6adb57b2 100644 --- a/test/Microsoft.AspNet.Mvc.FunctionalTests/MvcTestFixture.cs +++ b/test/Microsoft.AspNet.Mvc.FunctionalTests/MvcTestFixture.cs @@ -16,6 +16,7 @@ using Microsoft.Extensions.PlatformAbstractions; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging.Testing; +using Microsoft.AspNet.Hosting.Internal; namespace Microsoft.AspNet.Mvc.FunctionalTests { @@ -41,33 +42,22 @@ namespace Microsoft.AspNet.Mvc.FunctionalTests configureApplication = application => configureWithLogger(application, NullLoggerFactory.Instance); } - var buildServices = (Func)startupTypeInfo + var configureServices = (Action)startupTypeInfo .DeclaredMethods - .FirstOrDefault(m => m.Name == "ConfigureServices" && m.ReturnType == typeof(IServiceProvider)) - ?.CreateDelegate(typeof(Func), startupInstance); - if (buildServices == null) - { - var configureServices = (Action)startupTypeInfo - .DeclaredMethods - .FirstOrDefault(m => m.Name == "ConfigureServices" && m.ReturnType == typeof(void)) - ?.CreateDelegate(typeof(Action), startupInstance); - Debug.Assert(configureServices != null); - - buildServices = services => - { - configureServices(services); - return services.BuildServiceProvider(); - }; - } + .First(m => m.Name == "ConfigureServices") + .CreateDelegate(typeof(Action), startupInstance); // RequestLocalizationOptions saves the current culture when constructed, potentially changing response // localization i.e. RequestLocalizationMiddleware behavior. Ensure the saved culture // (DefaultRequestCulture) is consistent regardless of system configuration or personal preferences. using (new CultureReplacer()) { - _server = TestServer.Create( - configureApplication, - configureServices: InitializeServices(startupTypeInfo.Assembly, buildServices)); + var builder = new WebApplicationBuilder() + .Configure(configureApplication) + .ConfigureServices( + services => InitializeServices(startupTypeInfo.Assembly, services, configureServices)); + + _server = new TestServer(builder); } Client = _server.CreateClient(); @@ -86,9 +76,10 @@ namespace Microsoft.AspNet.Mvc.FunctionalTests { } - private Func InitializeServices( + private void InitializeServices( Assembly startupAssembly, - Func buildServices) + IServiceCollection services, + Action configureServices) { var libraryManager = PlatformServices.Default.LibraryManager; @@ -104,24 +95,24 @@ namespace Microsoft.AspNet.Mvc.FunctionalTests var applicationEnvironment = PlatformServices.Default.Application; - return (services) => + services.AddSingleton( + new TestApplicationEnvironment(applicationEnvironment, applicationName, applicationRoot)); + + var hostingEnvironment = new HostingEnvironment(); + hostingEnvironment.Initialize(applicationRoot, new WebApplicationOptions(), configuration: null); + services.AddSingleton(hostingEnvironment); + + // Inject a custom assembly provider. Overrides AddMvc() because that uses TryAdd(). + var assemblyProvider = new StaticAssemblyProvider(); + assemblyProvider.CandidateAssemblies.Add(startupAssembly); + services.AddSingleton(assemblyProvider); + + AddAdditionalServices(services); + + if (configureServices != null) { - services.AddSingleton( - new TestApplicationEnvironment(applicationEnvironment, applicationName, applicationRoot)); - - var hostingEnvironment = new HostingEnvironment(); - hostingEnvironment.Initialize(applicationRoot, new WebHostOptions(), configuration: null); - services.AddSingleton(hostingEnvironment); - - // Inject a custom assembly provider. Overrides AddMvc() because that uses TryAdd(). - var assemblyProvider = new StaticAssemblyProvider(); - assemblyProvider.CandidateAssemblies.Add(startupAssembly); - services.AddSingleton(assemblyProvider); - - AddAdditionalServices(services); - - return buildServices(services); - }; + configureServices(services); + } } } } diff --git a/test/WebSites/ControllersFromServicesWebSite/Startup.cs b/test/WebSites/ControllersFromServicesWebSite/Startup.cs index 2a9195a4c2..87fa04b365 100644 --- a/test/WebSites/ControllersFromServicesWebSite/Startup.cs +++ b/test/WebSites/ControllersFromServicesWebSite/Startup.cs @@ -1,7 +1,6 @@ // 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. -using System; using System.Reflection; using ControllersFromServicesClassLibrary; using Microsoft.AspNet.Builder; @@ -14,7 +13,7 @@ namespace ControllersFromServicesWebSite { public class Startup { - public IServiceProvider ConfigureServices(IServiceCollection services) + public void ConfigureServices(IServiceCollection services) { services .AddMvc() @@ -25,8 +24,6 @@ namespace ControllersFromServicesWebSite services.AddTransient(); services.AddSingleton(); - - return services.BuildServiceProvider(); } public void Configure(IApplicationBuilder app) diff --git a/test/WebSites/PrecompilationWebSite/Startup.cs b/test/WebSites/PrecompilationWebSite/Startup.cs index 3423aadb0c..8f4b610eb0 100644 --- a/test/WebSites/PrecompilationWebSite/Startup.cs +++ b/test/WebSites/PrecompilationWebSite/Startup.cs @@ -3,6 +3,7 @@ using System.Reflection; using Microsoft.AspNet.Builder; +using Microsoft.AspNet.Hosting; using Microsoft.Extensions.DependencyInjection; namespace PrecompilationWebSite @@ -24,5 +25,15 @@ namespace PrecompilationWebSite app.UseMvcWithDefaultRoute(); } + + public static void Main(string[] args) + { + var application = new WebApplicationBuilder() + .UseConfiguration(WebApplicationConfiguration.GetDefault(args)) + .UseStartup() + .Build(); + + application.Run(); + } } } diff --git a/test/WebSites/PrecompilationWebSite/hosting.json b/test/WebSites/PrecompilationWebSite/hosting.json new file mode 100644 index 0000000000..95505372fa --- /dev/null +++ b/test/WebSites/PrecompilationWebSite/hosting.json @@ -0,0 +1,3 @@ +{ + "server": "Microsoft.AspNet.Server.Kestrel" +} \ No newline at end of file diff --git a/test/WebSites/PrecompilationWebSite/project.json b/test/WebSites/PrecompilationWebSite/project.json index a33b583903..9ae6c1e7df 100644 --- a/test/WebSites/PrecompilationWebSite/project.json +++ b/test/WebSites/PrecompilationWebSite/project.json @@ -1,28 +1,31 @@ { - "commands": { - "web": "Microsoft.AspNet.Hosting server=Microsoft.AspNet.Server.WebListener server.urls=http://localhost:5001", - "kestrel": "Microsoft.AspNet.Hosting --server Microsoft.AspNet.Server.Kestrel --server.urls http://localhost:5000" + "commands": { + "web": "PrecompilationWebSite" + }, + "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": { - "Microsoft.AspNet.Server.Kestrel": "1.0.0-*", - "Microsoft.AspNet.Mvc": "6.0.0-*", - "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" + "dnxcore50": { + "compilationOptions": { + "define": [ "CUSTOM_DNXCORE50_DEFINE" ] + } + } + } } diff --git a/test/WebSites/RazorPageExecutionInstrumentationWebSite/Startup.cs b/test/WebSites/RazorPageExecutionInstrumentationWebSite/Startup.cs index 5ef676e8af..a9625754fc 100644 --- a/test/WebSites/RazorPageExecutionInstrumentationWebSite/Startup.cs +++ b/test/WebSites/RazorPageExecutionInstrumentationWebSite/Startup.cs @@ -4,6 +4,7 @@ using System.Diagnostics; using System.IO; using Microsoft.AspNet.Builder; +using Microsoft.AspNet.Hosting; using Microsoft.AspNet.Mvc.Razor.Compilation; using Microsoft.Extensions.DependencyInjection; @@ -42,5 +43,15 @@ namespace RazorPageExecutionInstrumentationWebSite // Add MVC to the request pipeline app.UseMvcWithDefaultRoute(); } + + public static void Main(string[] args) + { + var application = new WebApplicationBuilder() + .UseConfiguration(WebApplicationConfiguration.GetDefault(args)) + .UseStartup() + .Build(); + + application.Run(); + } } } diff --git a/test/WebSites/RazorPageExecutionInstrumentationWebSite/hosting.json b/test/WebSites/RazorPageExecutionInstrumentationWebSite/hosting.json new file mode 100644 index 0000000000..95505372fa --- /dev/null +++ b/test/WebSites/RazorPageExecutionInstrumentationWebSite/hosting.json @@ -0,0 +1,3 @@ +{ + "server": "Microsoft.AspNet.Server.Kestrel" +} \ No newline at end of file diff --git a/test/WebSites/RazorPageExecutionInstrumentationWebSite/project.json b/test/WebSites/RazorPageExecutionInstrumentationWebSite/project.json index aef9eb01eb..ae7e766945 100644 --- a/test/WebSites/RazorPageExecutionInstrumentationWebSite/project.json +++ b/test/WebSites/RazorPageExecutionInstrumentationWebSite/project.json @@ -1,19 +1,19 @@ { + "compilationOptions": { + "emitEntryPoint": true + }, "commands": { - "web": "Microsoft.AspNet.Hosting server=Microsoft.AspNet.Server.WebListener server.urls=http://localhost:5001", - "kestrel": "Microsoft.AspNet.Hosting --server Microsoft.AspNet.Server.Kestrel --server.urls http://localhost:5000" + "web": "RazorPageExecutionInstrumentationWebSite" }, "dependencies": { "Microsoft.AspNet.Mvc": "6.0.0-*", "Microsoft.AspNet.Mvc.TestConfiguration": "1.0.0", "Microsoft.AspNet.Server.Kestrel": "1.0.0-*", - "Microsoft.AspNet.Server.WebListener": "1.0.0-*", "Microsoft.AspNet.StaticFiles": "1.0.0-*", "Microsoft.Extensions.DiagnosticAdapter": "1.0.0-*" }, "frameworks": { "dnx451": { }, "dnxcore50": { } - }, - "webroot": "wwwroot" + } } diff --git a/test/WebSites/RazorWebSite/Startup.cs b/test/WebSites/RazorWebSite/Startup.cs index 19f5aca5c6..f28215bdd9 100644 --- a/test/WebSites/RazorWebSite/Startup.cs +++ b/test/WebSites/RazorWebSite/Startup.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Globalization; using Microsoft.AspNet.Builder; +using Microsoft.AspNet.Hosting; using Microsoft.AspNet.Localization; using Microsoft.AspNet.Mvc.Razor; using Microsoft.Extensions.DependencyInjection; @@ -62,5 +63,15 @@ namespace RazorWebSite app.UseMvcWithDefaultRoute(); } + + public static void Main(string[] args) + { + var application = new WebApplicationBuilder() + .UseConfiguration(WebApplicationConfiguration.GetDefault(args)) + .UseStartup() + .Build(); + + application.Run(); + } } } diff --git a/test/WebSites/RazorWebSite/hosting.json b/test/WebSites/RazorWebSite/hosting.json new file mode 100644 index 0000000000..95505372fa --- /dev/null +++ b/test/WebSites/RazorWebSite/hosting.json @@ -0,0 +1,3 @@ +{ + "server": "Microsoft.AspNet.Server.Kestrel" +} \ No newline at end of file diff --git a/test/WebSites/RazorWebSite/project.json b/test/WebSites/RazorWebSite/project.json index 16606c5bb1..5cff9cf37c 100644 --- a/test/WebSites/RazorWebSite/project.json +++ b/test/WebSites/RazorWebSite/project.json @@ -1,28 +1,28 @@ { - "commands": { - "web": "Microsoft.AspNet.Hosting server=Microsoft.AspNet.Server.WebListener server.urls=http://localhost:5001", - "kestrel": "Microsoft.AspNet.Hosting --server Microsoft.AspNet.Server.Kestrel --server.urls http://localhost:5000" + "commands": { + "web": "RazorWebSite" + }, + "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": { - "Microsoft.AspNet.Server.Kestrel": "1.0.0-*", - "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.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" + "dnxcore50": { + "compilationOptions": { + "define": [ "DNXCORE50_CUSTOM_DEFINE" ] + } + } + } } diff --git a/test/WebSites/RoutingWebSite/Startup.cs b/test/WebSites/RoutingWebSite/Startup.cs index 78bf71fe78..71558dd0de 100644 --- a/test/WebSites/RoutingWebSite/Startup.cs +++ b/test/WebSites/RoutingWebSite/Startup.cs @@ -2,6 +2,7 @@ // 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.Hosting; using Microsoft.AspNet.Mvc.Infrastructure; using Microsoft.Extensions.DependencyInjection; @@ -39,5 +40,15 @@ namespace RoutingWebSite "{controller}/{action}/{path?}"); }); } + + public static void Main(string[] args) + { + var application = new WebApplicationBuilder() + .UseConfiguration(WebApplicationConfiguration.GetDefault(args)) + .UseStartup() + .Build(); + + application.Run(); + } } } diff --git a/test/WebSites/RoutingWebSite/hosting.json b/test/WebSites/RoutingWebSite/hosting.json new file mode 100644 index 0000000000..95505372fa --- /dev/null +++ b/test/WebSites/RoutingWebSite/hosting.json @@ -0,0 +1,3 @@ +{ + "server": "Microsoft.AspNet.Server.Kestrel" +} \ No newline at end of file diff --git a/test/WebSites/RoutingWebSite/project.json b/test/WebSites/RoutingWebSite/project.json index 14c1cb9408..1613bd94c6 100644 --- a/test/WebSites/RoutingWebSite/project.json +++ b/test/WebSites/RoutingWebSite/project.json @@ -1,18 +1,18 @@ { - "commands": { - "web": "Microsoft.AspNet.Hosting server=Microsoft.AspNet.Server.WebListener server.urls=http://localhost:5001", - "kestrel": "Microsoft.AspNet.Hosting --server Microsoft.AspNet.Server.Kestrel --server.urls http://localhost:5000" - }, - "dependencies": { - "Microsoft.AspNet.Server.Kestrel": "1.0.0-*", - "Microsoft.AspNet.Mvc": "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": { }, - "dnxcore50": { } - }, - "webroot": "wwwroot" + "compilationOptions": { + "emitEntryPoint": true + }, + "commands": { + "web": "RoutingWebSite" + }, + "dependencies": { + "Microsoft.AspNet.Mvc": "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": { }, + "dnxcore50": { } + } } diff --git a/test/WebSites/SimpleWebSite/Startup.cs b/test/WebSites/SimpleWebSite/Startup.cs index 2b0cb50f81..b30ef98990 100644 --- a/test/WebSites/SimpleWebSite/Startup.cs +++ b/test/WebSites/SimpleWebSite/Startup.cs @@ -3,6 +3,7 @@ using System.Text.Encodings.Web; using Microsoft.AspNet.Builder; +using Microsoft.AspNet.Hosting; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.WebEncoders.Testing; using Microsoft.Net.Http.Headers; @@ -27,5 +28,15 @@ namespace SimpleWebSite { app.UseMvcWithDefaultRoute(); } + + public static void Main(string[] args) + { + var application = new WebApplicationBuilder() + .UseConfiguration(WebApplicationConfiguration.GetDefault(args)) + .UseStartup() + .Build(); + + application.Run(); + } } } diff --git a/test/WebSites/SimpleWebSite/hosting.json b/test/WebSites/SimpleWebSite/hosting.json new file mode 100644 index 0000000000..95505372fa --- /dev/null +++ b/test/WebSites/SimpleWebSite/hosting.json @@ -0,0 +1,3 @@ +{ + "server": "Microsoft.AspNet.Server.Kestrel" +} \ No newline at end of file diff --git a/test/WebSites/SimpleWebSite/project.json b/test/WebSites/SimpleWebSite/project.json index 39e5b21da1..0cca3a7c32 100644 --- a/test/WebSites/SimpleWebSite/project.json +++ b/test/WebSites/SimpleWebSite/project.json @@ -1,12 +1,13 @@ { + "compilationOptions": { + "emitEntryPoint": true + }, "commands": { - "web": "Microsoft.AspNet.Server.Kestrel", - "weblistener": "Microsoft.AspNet.Server.WebListener" + "web": "SimpleWebSite" }, "dependencies": { "Microsoft.AspNet.Mvc": "6.0.0-*", - "Microsoft.AspNet.Server.Kestrel": "1.0.0-*", - "Microsoft.AspNet.Server.WebListener": "1.0.0-*" + "Microsoft.AspNet.Server.Kestrel": "1.0.0-*" }, "frameworks": { "dnx451": { }, diff --git a/test/WebSites/TagHelpersWebSite/Startup.cs b/test/WebSites/TagHelpersWebSite/Startup.cs index 86df86dc2d..0d5d9e222c 100644 --- a/test/WebSites/TagHelpersWebSite/Startup.cs +++ b/test/WebSites/TagHelpersWebSite/Startup.cs @@ -2,6 +2,7 @@ // 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.Hosting; using Microsoft.Extensions.DependencyInjection; namespace TagHelpersWebSite @@ -20,5 +21,15 @@ namespace TagHelpersWebSite app.UseMvcWithDefaultRoute(); } + + public static void Main(string[] args) + { + var application = new WebApplicationBuilder() + .UseConfiguration(WebApplicationConfiguration.GetDefault(args)) + .UseStartup() + .Build(); + + application.Run(); + } } } diff --git a/test/WebSites/TagHelpersWebSite/hosting.json b/test/WebSites/TagHelpersWebSite/hosting.json new file mode 100644 index 0000000000..95505372fa --- /dev/null +++ b/test/WebSites/TagHelpersWebSite/hosting.json @@ -0,0 +1,3 @@ +{ + "server": "Microsoft.AspNet.Server.Kestrel" +} \ No newline at end of file diff --git a/test/WebSites/TagHelpersWebSite/project.json b/test/WebSites/TagHelpersWebSite/project.json index a0c57feb2d..03ef2ce5ce 100644 --- a/test/WebSites/TagHelpersWebSite/project.json +++ b/test/WebSites/TagHelpersWebSite/project.json @@ -1,19 +1,19 @@ { - "commands": { - "web": "Microsoft.AspNet.Hosting server=Microsoft.AspNet.Server.WebListener server.urls=http://localhost:5001", - "kestrel": "Microsoft.AspNet.Hosting --server Microsoft.AspNet.Server.Kestrel --server.urls http://localhost:5000" - }, - "dependencies": { - "Microsoft.AspNet.Server.Kestrel": "1.0.0-*", - "Microsoft.AspNet.Mvc": "6.0.0-*", - "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-*" - }, - "frameworks": { - "dnx451": { }, - "dnxcore50": { } - }, - "webroot": "wwwroot" + "compilationOptions": { + "emitEntryPoint": true + }, + "commands": { + "web": "TagHelpersWebSite" + }, + "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-*" + }, + "frameworks": { + "dnx451": { }, + "dnxcore50": { } + } } diff --git a/test/WebSites/VersioningWebSite/Startup.cs b/test/WebSites/VersioningWebSite/Startup.cs index 6d27b596f4..a40454bdbe 100644 --- a/test/WebSites/VersioningWebSite/Startup.cs +++ b/test/WebSites/VersioningWebSite/Startup.cs @@ -2,6 +2,7 @@ // 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.Hosting; using Microsoft.AspNet.Mvc.Infrastructure; using Microsoft.Extensions.DependencyInjection; @@ -24,5 +25,15 @@ namespace VersioningWebSite app.UseMvcWithDefaultRoute(); } + + public static void Main(string[] args) + { + var application = new WebApplicationBuilder() + .UseConfiguration(WebApplicationConfiguration.GetDefault(args)) + .UseStartup() + .Build(); + + application.Run(); + } } } diff --git a/test/WebSites/VersioningWebSite/hosting.json b/test/WebSites/VersioningWebSite/hosting.json new file mode 100644 index 0000000000..95505372fa --- /dev/null +++ b/test/WebSites/VersioningWebSite/hosting.json @@ -0,0 +1,3 @@ +{ + "server": "Microsoft.AspNet.Server.Kestrel" +} \ No newline at end of file diff --git a/test/WebSites/VersioningWebSite/project.json b/test/WebSites/VersioningWebSite/project.json index 14c1cb9408..f6d57b4f3d 100644 --- a/test/WebSites/VersioningWebSite/project.json +++ b/test/WebSites/VersioningWebSite/project.json @@ -1,18 +1,18 @@ { - "commands": { - "web": "Microsoft.AspNet.Hosting server=Microsoft.AspNet.Server.WebListener server.urls=http://localhost:5001", - "kestrel": "Microsoft.AspNet.Hosting --server Microsoft.AspNet.Server.Kestrel --server.urls http://localhost:5000" - }, - "dependencies": { - "Microsoft.AspNet.Server.Kestrel": "1.0.0-*", - "Microsoft.AspNet.Mvc": "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": { }, - "dnxcore50": { } - }, - "webroot": "wwwroot" + "compilationOptions": { + "emitEntryPoint": true + }, + "commands": { + "web": "VersioningWebSite" + }, + "dependencies": { + "Microsoft.AspNet.Mvc": "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": { }, + "dnxcore50": { } + } } diff --git a/test/WebSites/WebApiCompatShimWebSite/Startup.cs b/test/WebSites/WebApiCompatShimWebSite/Startup.cs index 3de5a21655..141e95bc82 100644 --- a/test/WebSites/WebApiCompatShimWebSite/Startup.cs +++ b/test/WebSites/WebApiCompatShimWebSite/Startup.cs @@ -2,7 +2,7 @@ // 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.Routing; +using Microsoft.AspNet.Hosting; using Microsoft.Extensions.DependencyInjection; namespace WebApiCompatShimWebSite @@ -32,5 +32,15 @@ namespace WebApiCompatShimWebSite routes.MapRoute("default", "{controller}/{action}/{id?}"); }); } + + public static void Main(string[] args) + { + var application = new WebApplicationBuilder() + .UseConfiguration(WebApplicationConfiguration.GetDefault(args)) + .UseStartup() + .Build(); + + application.Run(); + } } } diff --git a/test/WebSites/WebApiCompatShimWebSite/hosting.json b/test/WebSites/WebApiCompatShimWebSite/hosting.json new file mode 100644 index 0000000000..95505372fa --- /dev/null +++ b/test/WebSites/WebApiCompatShimWebSite/hosting.json @@ -0,0 +1,3 @@ +{ + "server": "Microsoft.AspNet.Server.Kestrel" +} \ No newline at end of file diff --git a/test/WebSites/WebApiCompatShimWebSite/project.json b/test/WebSites/WebApiCompatShimWebSite/project.json index 33d76230a9..908438d2fe 100644 --- a/test/WebSites/WebApiCompatShimWebSite/project.json +++ b/test/WebSites/WebApiCompatShimWebSite/project.json @@ -1,19 +1,19 @@ { - "commands": { - "web": "Microsoft.AspNet.Hosting server=Microsoft.AspNet.Server.WebListener server.urls=http://localhost:5001", - "kestrel": "Microsoft.AspNet.Hosting --server Microsoft.AspNet.Server.Kestrel --server.urls http://localhost:5000" - }, - "dependencies": { - "Microsoft.AspNet.Server.Kestrel": "1.0.0-*", - "Microsoft.AspNet.Mvc": "6.0.0-*", - "Microsoft.AspNet.Mvc.TestConfiguration": "1.0.0", - "Microsoft.AspNet.Mvc.WebApiCompatShim": "6.0.0-*", - "Microsoft.AspNet.Server.WebListener": "1.0.0-*", - "Microsoft.AspNet.StaticFiles": "1.0.0-*" - }, - "frameworks": { - "dnx451": { }, - "dnxcore50": { } - }, - "webroot": "wwwroot" + "compilationOptions": { + "emitEntryPoint": true + }, + "commands": { + "web": "WebApiCompatShimWebSite" + }, + "dependencies": { + "Microsoft.AspNet.Mvc": "6.0.0-*", + "Microsoft.AspNet.Mvc.TestConfiguration": "1.0.0", + "Microsoft.AspNet.Mvc.WebApiCompatShim": "6.0.0-*", + "Microsoft.AspNet.Server.Kestrel": "1.0.0-*", + "Microsoft.AspNet.StaticFiles": "1.0.0-*" + }, + "frameworks": { + "dnx451": { }, + "dnxcore50": { } + } } diff --git a/test/WebSites/XmlFormattersWebSite/Startup.cs b/test/WebSites/XmlFormattersWebSite/Startup.cs index 1bf991b783..ef78fa15e1 100644 --- a/test/WebSites/XmlFormattersWebSite/Startup.cs +++ b/test/WebSites/XmlFormattersWebSite/Startup.cs @@ -2,6 +2,7 @@ // 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.Hosting; using Microsoft.AspNet.Mvc; using Microsoft.AspNet.Mvc.Formatters; using Microsoft.Extensions.DependencyInjection; @@ -75,5 +76,15 @@ namespace XmlFormattersWebSite defaults: new { controller = "Home", action = "Index" }); }); } + + public static void Main(string[] args) + { + var application = new WebApplicationBuilder() + .UseConfiguration(WebApplicationConfiguration.GetDefault(args)) + .UseStartup() + .Build(); + + application.Run(); + } } } diff --git a/test/WebSites/XmlFormattersWebSite/hosting.json b/test/WebSites/XmlFormattersWebSite/hosting.json new file mode 100644 index 0000000000..95505372fa --- /dev/null +++ b/test/WebSites/XmlFormattersWebSite/hosting.json @@ -0,0 +1,3 @@ +{ + "server": "Microsoft.AspNet.Server.Kestrel" +} \ No newline at end of file diff --git a/test/WebSites/XmlFormattersWebSite/project.json b/test/WebSites/XmlFormattersWebSite/project.json index 2405041d37..df6cac572b 100644 --- a/test/WebSites/XmlFormattersWebSite/project.json +++ b/test/WebSites/XmlFormattersWebSite/project.json @@ -1,23 +1,23 @@ { - "commands": { - "web": "Microsoft.AspNet.Hosting server=Microsoft.AspNet.Server.WebListener server.urls=http://localhost:5001", - "kestrel": "Microsoft.AspNet.Hosting --server Microsoft.AspNet.Server.Kestrel --server.urls http://localhost:5000" - }, - "dependencies": { - "Microsoft.AspNet.Server.Kestrel": "1.0.0-*", - "Microsoft.AspNet.Mvc": "6.0.0-*", - "Microsoft.AspNet.Mvc.Formatters.Xml": "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": { }, - "dnxcore50": { - "dependencies": { - "System.Linq.Queryable": "4.0.1-*" - } - } - }, - "webroot": "wwwroot" + "compilationOptions": { + "emitEntryPoint": true + }, + "commands": { + "web": "XmlFormattersWebSite" + }, + "dependencies": { + "Microsoft.AspNet.Mvc": "6.0.0-*", + "Microsoft.AspNet.Mvc.Formatters.Xml": "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": { }, + "dnxcore50": { + "dependencies": { + "System.Linq.Queryable": "4.0.1-*" + } + } + } }