diff --git a/MetaPackages.sln b/MetaPackages.sln index 6de1068cba..c5c63d90c3 100644 --- a/MetaPackages.sln +++ b/MetaPackages.sln @@ -20,13 +20,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{F92CB7A1 build\repo.targets = build\repo.targets EndProjectSection EndProject - Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.RuntimeStore", "src\Microsoft.AspNetCore.RuntimeStore\Microsoft.AspNetCore.RuntimeStore.csproj", "{A4585E19-FC49-43B4-9416-0BD3120EAD32}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "samples", "samples", "{192F583C-C4CA-43E5-B31C-D21B7806E274}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SampleApp", "samples\SampleApp\SampleApp.csproj", "{AF5BB04E-92F7-4737-8B98-F86F6244FAB2}" -EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -41,10 +36,6 @@ Global {CC8F551E-213A-45E8-AECA-507C4DB4F164}.Debug|Any CPU.Build.0 = Debug|Any CPU {CC8F551E-213A-45E8-AECA-507C4DB4F164}.Release|Any CPU.ActiveCfg = Release|Any CPU {CC8F551E-213A-45E8-AECA-507C4DB4F164}.Release|Any CPU.Build.0 = Release|Any CPU - {AF5BB04E-92F7-4737-8B98-F86F6244FAB2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {AF5BB04E-92F7-4737-8B98-F86F6244FAB2}.Debug|Any CPU.Build.0 = Debug|Any CPU - {AF5BB04E-92F7-4737-8B98-F86F6244FAB2}.Release|Any CPU.ActiveCfg = Release|Any CPU - {AF5BB04E-92F7-4737-8B98-F86F6244FAB2}.Release|Any CPU.Build.0 = Release|Any CPU {A4585E19-FC49-43B4-9416-0BD3120EAD32}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {A4585E19-FC49-43B4-9416-0BD3120EAD32}.Debug|Any CPU.Build.0 = Debug|Any CPU {A4585E19-FC49-43B4-9416-0BD3120EAD32}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -57,7 +48,6 @@ Global {6F3D43F7-9546-4B41-AF04-CF4708B62051} = {ED834E68-51C3-4ADE-ACC8-6BA6D4207C09} {CC8F551E-213A-45E8-AECA-507C4DB4F164} = {ED834E68-51C3-4ADE-ACC8-6BA6D4207C09} {F92CB7A1-C38E-408C-A7EC-A5C040D041E1} = {97D53BEB-A511-4FBE-B784-AB407D9A219F} - {AF5BB04E-92F7-4737-8B98-F86F6244FAB2} = {192F583C-C4CA-43E5-B31C-D21B7806E274} {A4585E19-FC49-43B4-9416-0BD3120EAD32} = {ED834E68-51C3-4ADE-ACC8-6BA6D4207C09} EndGlobalSection EndGlobal diff --git a/build/Key.snk b/build/Key.snk deleted file mode 100644 index e10e4889c1..0000000000 Binary files a/build/Key.snk and /dev/null differ diff --git a/build/common.props b/build/common.props index dfd6c25f34..30a0a74a67 100644 --- a/build/common.props +++ b/build/common.props @@ -31,8 +31,6 @@ - - @@ -131,8 +129,10 @@ + + diff --git a/build/dependencies.props b/build/dependencies.props index f5484bca6f..b8b54468e7 100644 --- a/build/dependencies.props +++ b/build/dependencies.props @@ -5,6 +5,5 @@ 4.3.0 2.0.0-* 1.6.1 - 2.0.0-* \ No newline at end of file diff --git a/samples/SampleApp/Program.cs b/samples/SampleApp/Program.cs deleted file mode 100644 index e78eab19d1..0000000000 --- a/samples/SampleApp/Program.cs +++ /dev/null @@ -1,63 +0,0 @@ -using System; -using Microsoft.AspNetCore; -using Microsoft.AspNetCore.Hosting; -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Routing; - -namespace SampleApp -{ - public class Program - { - public static void Main(string[] args) - { - //HelloWorld(); - - //CustomUrl(); - - Router(); - - //StartupClass(args); - } - - private static void HelloWorld() - { - var host = WebHost.Start(context => context.Response.WriteAsync("Hello, World!")); - //host.WaitForShutdown(); // TODO: This method needs to be added to Hosting - Console.WriteLine("Press any key to shutdown..."); - Console.ReadKey(); - } - - private static void CustomUrl() - { - // Changing the listening URL - var host = WebHost.Start("http://localhost:8080", context => context.Response.WriteAsync("Hello, World!")); - //host.WaitForShutdown(); // TODO: This method needs to be added to Hosting - Console.WriteLine("Press any key to shutdown..."); - Console.ReadKey(); - } - - private static void Router() - { - // Using a router - var host = WebHost.Start(router => router - .MapGet("hello/{name}", (req, res, data) => res.WriteAsync($"Hello, {data.Values["name"]}")) - .MapGet("goodbye/{name}", (req, res, data) => res.WriteAsync($"Goodbye, {data.Values["name"]}")) - .MapGet("throw/{message?}", (req, res, data) => throw new Exception((string)data.Values["message"] ?? "Uh oh!")) - .MapGet("{greeting}/{name}", (req, res, data) => res.WriteAsync($"{data.Values["greeting"]}, {data.Values["name"]}")) - .MapGet("", (req, res, data) => res.WriteAsync($"Hello, World!")) - ); - //host.WaitForShutdown(); // TODO: This method needs to be added to Hosting - Console.WriteLine("Press any key to shutdown..."); - Console.ReadKey(); - } - - private static void StartupClass(string[] args) - { - // Using defaults with a Startup class - var host = WebHost.CreateDefaultBuilder(args) - .UseStartup() - .Build(); - host.Run(); - } - } -} diff --git a/samples/SampleApp/Properties/launchSettings.json b/samples/SampleApp/Properties/launchSettings.json deleted file mode 100644 index f0370cf22b..0000000000 --- a/samples/SampleApp/Properties/launchSettings.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "iisSettings": { - "windowsAuthentication": false, - "anonymousAuthentication": true, - "iisExpress": { - "applicationUrl": "http://localhost:53432/", - "sslPort": 0 - } - }, - "profiles": { - "IIS Express": { - "commandName": "IISExpress", - "launchBrowser": true, - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - } - }, - "SampleApp": { - "commandName": "Project", - "launchBrowser": true, - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - }, - "applicationUrl": "http://localhost:53433" - } - } -} diff --git a/samples/SampleApp/SampleApp.csproj b/samples/SampleApp/SampleApp.csproj deleted file mode 100644 index a3520ca464..0000000000 --- a/samples/SampleApp/SampleApp.csproj +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - netcoreapp2.0 - aspnetcore-MetaPackagesSampleApp-20170406180413 - - - - - - - - - - - diff --git a/samples/SampleApp/Startup.cs b/samples/SampleApp/Startup.cs deleted file mode 100644 index 0f8e756160..0000000000 --- a/samples/SampleApp/Startup.cs +++ /dev/null @@ -1,28 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Builder; -using Microsoft.AspNetCore.Hosting; -using Microsoft.AspNetCore.Http; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Logging; - -namespace SampleApp -{ - public class Startup - { - public void ConfigureServices(IServiceCollection services) - { - - } - - public void Configure(IApplicationBuilder app, IHostingEnvironment env) - { - app.Run(async (context) => - { - await context.Response.WriteAsync($"Hello from {nameof(Startup)}!"); - }); - } - } -} diff --git a/src/Microsoft.AspNetCore/Microsoft.AspNetCore.csproj b/src/Microsoft.AspNetCore/Microsoft.AspNetCore.csproj index 1ce6696c7a..1299f3569e 100644 --- a/src/Microsoft.AspNetCore/Microsoft.AspNetCore.csproj +++ b/src/Microsoft.AspNetCore/Microsoft.AspNetCore.csproj @@ -3,14 +3,10 @@ - true - netstandard1.5 + false + netstandard1.3 aspnetcore Microsoft.AspNetCore - false - ..\..\build\Key.snk - true - true diff --git a/src/Microsoft.AspNetCore/WebHost.cs b/src/Microsoft.AspNetCore/WebHost.cs deleted file mode 100644 index 4aa1a87df8..0000000000 --- a/src/Microsoft.AspNetCore/WebHost.cs +++ /dev/null @@ -1,179 +0,0 @@ -// 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.IO; -using System.Reflection; -using Microsoft.AspNetCore.Builder; -using Microsoft.AspNetCore.Hosting; -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Routing; -using Microsoft.Extensions.Configuration; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Logging; - -namespace Microsoft.AspNetCore -{ - /// - /// Provides convenience methods for creating instances of and with pre-configured defaults. - /// - public static class WebHost - { - /// - /// Initializes and starts a new with pre-configured defaults. - /// See for details. - /// - /// A delegate that handles requests to the application. - /// A started that hosts the application. - public static IWebHost Start(RequestDelegate app) => - Start(null, app); - - /// - /// Initializes and starts a new with pre-configured defaults. - /// See for details. - /// - /// The URL the hosted application will listen on. - /// A delegate that handles requests to the application. - /// A started that hosts the application. - public static IWebHost Start(string url, RequestDelegate app) => - StartWith(url, appBuilder => appBuilder.Run(app)); - - /// - /// Initializes and starts a new with pre-configured defaults. - /// See for details. - /// - /// A delegate that configures the router for handling requests to the application. - /// A started that hosts the application. - public static IWebHost Start(Action routeBuilder) => - Start(null, routeBuilder); - - /// - /// Initializes and starts a new with pre-configured defaults. - /// See for details. - /// - /// The URL the hosted application will listen on. - /// A delegate that configures the router for handling requests to the application. - /// A started that hosts the application. - public static IWebHost Start(string url, Action routeBuilder) => - StartWith(url, services => services.AddRouting(), app => app.UseRouter(routeBuilder)); - - /// - /// Initializes and starts a new with pre-configured defaults. - /// See for details. - /// - /// A delegate that handles requests to the application. - /// A started that hosts the application. - public static IWebHost StartWith(Action app) => - StartWith(null, app); - - /// - /// Initializes and starts a new with pre-configured defaults. - /// See for details. - /// - /// The URL the hosted application will listen on. - /// The delegate that configures the . - /// A started that hosts the application. - public static IWebHost StartWith(string url, Action app) => - StartWith(url, null, app); - - private static IWebHost StartWith(string url, Action configureServices, Action app) - { - var builder = CreateDefaultBuilder(); - - if (!string.IsNullOrEmpty(url)) - { - builder.UseUrls(url); - } - - if (configureServices != null) - { - builder.ConfigureServices(configureServices); - } - - var host = builder - .Configure(app) - .Build(); - - host.Start(); - - return host; - } - - /// - /// Initializes a new instance of the class with pre-configured defaults. - /// - /// - /// The following defaults are applied to the returned : - /// use Kestrel as the web server, - /// set the to the result of , - /// load from 'appsettings.json' and 'appsettings.[].json', - /// load from User Secrets when is 'Development' using the entry assembly, - /// load from environment variables, - /// configures the to log to the console, - /// enables IIS integration, - /// and adds the developer exception page when is 'Development' - /// - /// The initialized . - public static IWebHostBuilder CreateDefaultBuilder() => - CreateDefaultBuilder(null); - - /// - /// Initializes a new instance of the class with pre-configured defaults. - /// - /// - /// The following defaults are applied to the returned : - /// use Kestrel as the web server, - /// set the to the result of , - /// load from 'appsettings.json' and 'appsettings.[].json', - /// load from User Secrets when is 'Development' using the entry assembly, - /// load from environment variables, - /// load from supplied command line args, - /// configures the to log to the console, - /// enables IIS integration, - /// and adds the developer exception page when is 'Development' - /// - /// The command line args. - /// The initialized . - public static IWebHostBuilder CreateDefaultBuilder(string[] args) - { - var builder = new WebHostBuilder() - .UseKestrel() - .UseContentRoot(Directory.GetCurrentDirectory()) - .ConfigureConfiguration((hostingContext, config) => - { - var env = hostingContext.HostingEnvironment; - - config.AddJsonFile("appsettings.json", optional: true, reloadOnChange: true) - .AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true, reloadOnChange: true); - - if (env.IsDevelopment()) - { - var appAssembly = Assembly.GetEntryAssembly(); - if (appAssembly != null) - { - config.AddUserSecrets(appAssembly); - } - } - - config.AddEnvironmentVariables(); - - if (args != null) - { - config.AddCommandLine(args); - } - }) - .ConfigureLogging(logging => - { - logging.AddConsole(); - }) - // TODO: Remove this when ANCM injects it by default - .UseIISIntegration() - .ConfigureServices(services => - { - services.AddSingleton(); - }); - - return builder; - } - } -} diff --git a/src/Microsoft.AspNetCore/WebHostStartupFilter.cs b/src/Microsoft.AspNetCore/WebHostStartupFilter.cs deleted file mode 100644 index 43690799ce..0000000000 --- a/src/Microsoft.AspNetCore/WebHostStartupFilter.cs +++ /dev/null @@ -1,26 +0,0 @@ -// 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.AspNetCore.Builder; -using Microsoft.AspNetCore.Hosting; -using Microsoft.Extensions.DependencyInjection; - -namespace Microsoft.AspNetCore -{ - internal class WebHostStartupFilter : IStartupFilter - { - public Action Configure(Action next) - { - return app => - { - var env = app.ApplicationServices.GetService(); - if (env.IsDevelopment()) - { - app.UseDeveloperExceptionPage(); - } - next(app); - }; - } - } -}