From 999dc40915cc153b83aafc0aa5156c28cd646be2 Mon Sep 17 00:00:00 2001 From: Tommy Parnell Date: Sun, 23 Oct 2016 18:41:20 -0400 Subject: [PATCH] update to stdlib --- Alive.Net.sln | 14 +- global.json | 2 +- src/Alive.Net.Example/Alive.Net.Example.xproj | 12 +- .../Controllers/HomeController.cs | 2 +- src/Alive.Net.Example/Program.cs | 24 +++ src/Alive.Net.Example/Project_Readme.html | 187 ++++++++++++++++++ .../Properties/launchSettings.json | 12 +- src/Alive.Net.Example/Startup.cs | 57 +++--- src/Alive.Net.Example/Views/Home/Index.cshtml | 37 ++-- .../Views/Shared/Error.cshtml | 8 + .../Views/Shared/_Layout.cshtml | 14 +- .../Views/_ViewImports.cshtml | 2 +- src/Alive.Net.Example/appsettings.json | 2 +- src/Alive.Net.Example/bower.json | 8 +- src/Alive.Net.Example/bundleconfig.json | 24 +++ src/Alive.Net.Example/gulpfile.js | 45 ----- src/Alive.Net.Example/package.json | 11 -- src/Alive.Net.Example/project.json | 88 +++++---- src/Alive.Net.Example/web.config | 14 ++ src/Alive.Net.Example/wwwroot/_references.js | 1 - src/Alive.Net.Example/wwwroot/css/site.css | 26 +-- .../wwwroot/css/site.min.css | 1 + .../wwwroot/images/ASP-NET-Banners-01.png | Bin 8314 -> 0 bytes .../wwwroot/images/ASP-NET-Banners-02.png | Bin 8616 -> 0 bytes .../wwwroot/images/Banner-01-Azure.png | Bin 14436 -> 0 bytes .../wwwroot/images/Banner-02-VS.png | Bin 12388 -> 0 bytes .../wwwroot/images/banner1.svg | 1 + .../wwwroot/images/banner2.svg | 1 + .../wwwroot/images/banner3.svg | 1 + .../wwwroot/images/banner4.svg | 1 + src/Alive.Net.Example/wwwroot/js/site.min.js | 0 src/Alive.Net.Example/wwwroot/web.config | 9 - .../Alive.Net.UnitTests.xproj | 2 +- src/Alive.Net.UnitTests/MainUnitTests.cs | 2 +- src/Alive.Net.UnitTests/project.json | 21 +- src/Alive.Net/Alive.Net.xproj | 6 +- src/Alive.Net/Alive.cs | 4 +- src/Alive.Net/AliveOptions.cs | 2 +- src/Alive.Net/project.json | 29 ++- 39 files changed, 442 insertions(+), 228 deletions(-) create mode 100644 src/Alive.Net.Example/Program.cs create mode 100644 src/Alive.Net.Example/Project_Readme.html create mode 100644 src/Alive.Net.Example/bundleconfig.json delete mode 100644 src/Alive.Net.Example/gulpfile.js delete mode 100644 src/Alive.Net.Example/package.json create mode 100644 src/Alive.Net.Example/web.config create mode 100644 src/Alive.Net.Example/wwwroot/css/site.min.css delete mode 100644 src/Alive.Net.Example/wwwroot/images/ASP-NET-Banners-01.png delete mode 100644 src/Alive.Net.Example/wwwroot/images/ASP-NET-Banners-02.png delete mode 100644 src/Alive.Net.Example/wwwroot/images/Banner-01-Azure.png delete mode 100644 src/Alive.Net.Example/wwwroot/images/Banner-02-VS.png create mode 100644 src/Alive.Net.Example/wwwroot/images/banner1.svg create mode 100644 src/Alive.Net.Example/wwwroot/images/banner2.svg create mode 100644 src/Alive.Net.Example/wwwroot/images/banner3.svg create mode 100644 src/Alive.Net.Example/wwwroot/images/banner4.svg create mode 100644 src/Alive.Net.Example/wwwroot/js/site.min.js delete mode 100644 src/Alive.Net.Example/wwwroot/web.config diff --git a/Alive.Net.sln b/Alive.Net.sln index e08fa08..58dd8ed 100644 --- a/Alive.Net.sln +++ b/Alive.Net.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 14 -VisualStudioVersion = 14.0.24720.0 +VisualStudioVersion = 14.0.25420.1 MinimumVisualStudioVersion = 10.0.40219.1 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{87BBACD9-21A7-4169-94B9-DD6989B700B7}" EndProject @@ -14,7 +14,7 @@ Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Alive.Net", "src\Alive.Net\ EndProject Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Alive.Net.UnitTests", "src\Alive.Net.UnitTests\Alive.Net.UnitTests.xproj", "{4CA8001B-27C7-4671-B451-2C2DA00A3827}" EndProject -Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Alive.Net.Example", "src\Alive.Net.Example\Alive.Net.Example.xproj", "{43D7C97A-6041-492F-95C6-FD88C7FA7A7B}" +Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Alive.Net.Example", "src\Alive.Net.Example\Alive.Net.Example.xproj", "{52512D4E-0F12-4202-AB70-B93EAF4C5531}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -30,10 +30,10 @@ Global {4CA8001B-27C7-4671-B451-2C2DA00A3827}.Debug|Any CPU.Build.0 = Debug|Any CPU {4CA8001B-27C7-4671-B451-2C2DA00A3827}.Release|Any CPU.ActiveCfg = Release|Any CPU {4CA8001B-27C7-4671-B451-2C2DA00A3827}.Release|Any CPU.Build.0 = Release|Any CPU - {43D7C97A-6041-492F-95C6-FD88C7FA7A7B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {43D7C97A-6041-492F-95C6-FD88C7FA7A7B}.Debug|Any CPU.Build.0 = Debug|Any CPU - {43D7C97A-6041-492F-95C6-FD88C7FA7A7B}.Release|Any CPU.ActiveCfg = Release|Any CPU - {43D7C97A-6041-492F-95C6-FD88C7FA7A7B}.Release|Any CPU.Build.0 = Release|Any CPU + {52512D4E-0F12-4202-AB70-B93EAF4C5531}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {52512D4E-0F12-4202-AB70-B93EAF4C5531}.Debug|Any CPU.Build.0 = Debug|Any CPU + {52512D4E-0F12-4202-AB70-B93EAF4C5531}.Release|Any CPU.ActiveCfg = Release|Any CPU + {52512D4E-0F12-4202-AB70-B93EAF4C5531}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -41,6 +41,6 @@ Global GlobalSection(NestedProjects) = preSolution {1628A48E-DD1D-45C7-A316-6CFD8498845C} = {87BBACD9-21A7-4169-94B9-DD6989B700B7} {4CA8001B-27C7-4671-B451-2C2DA00A3827} = {87BBACD9-21A7-4169-94B9-DD6989B700B7} - {43D7C97A-6041-492F-95C6-FD88C7FA7A7B} = {87BBACD9-21A7-4169-94B9-DD6989B700B7} + {52512D4E-0F12-4202-AB70-B93EAF4C5531} = {87BBACD9-21A7-4169-94B9-DD6989B700B7} EndGlobalSection EndGlobal diff --git a/global.json b/global.json index 5ba986f..9d09ab5 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "projects": [ "src", "test" ], "sdk": { - "version": "1.0.0-rc1-update1" + "version": "1.0.0-preview2-003131" } } diff --git a/src/Alive.Net.Example/Alive.Net.Example.xproj b/src/Alive.Net.Example/Alive.Net.Example.xproj index c1caffa..02f9be9 100644 --- a/src/Alive.Net.Example/Alive.Net.Example.xproj +++ b/src/Alive.Net.Example/Alive.Net.Example.xproj @@ -4,12 +4,13 @@ 14.0 $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - + - 43d7c97a-6041-492f-95c6-fd88c7fa7a7b + 52512d4e-0f12-4202-ab70-b93eaf4c5531 Alive.Net.Example - ..\..\artifacts\obj\$(MSBuildProjectName) - ..\..\artifacts\bin\$(MSBuildProjectName)\ + .\obj + .\bin\ + v4.5.2 2.0 @@ -17,7 +18,6 @@ - - + diff --git a/src/Alive.Net.Example/Controllers/HomeController.cs b/src/Alive.Net.Example/Controllers/HomeController.cs index 588ac04..04f589a 100644 --- a/src/Alive.Net.Example/Controllers/HomeController.cs +++ b/src/Alive.Net.Example/Controllers/HomeController.cs @@ -2,7 +2,7 @@ using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; -using Microsoft.AspNet.Mvc; +using Microsoft.AspNetCore.Mvc; namespace Alive.Net.Example.Controllers { diff --git a/src/Alive.Net.Example/Program.cs b/src/Alive.Net.Example/Program.cs new file mode 100644 index 0000000..d4b6b3d --- /dev/null +++ b/src/Alive.Net.Example/Program.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Hosting; + +namespace Alive.Net.Example +{ + public class Program + { + public static void Main(string[] args) + { + var host = new WebHostBuilder() + .UseKestrel() + .UseContentRoot(Directory.GetCurrentDirectory()) + .UseIISIntegration() + .UseStartup() + .Build(); + + host.Run(); + } + } +} diff --git a/src/Alive.Net.Example/Project_Readme.html b/src/Alive.Net.Example/Project_Readme.html new file mode 100644 index 0000000..1a0f5b5 --- /dev/null +++ b/src/Alive.Net.Example/Project_Readme.html @@ -0,0 +1,187 @@ + + + + + Welcome to ASP.NET Core + + + + + + + + + + diff --git a/src/Alive.Net.Example/Properties/launchSettings.json b/src/Alive.Net.Example/Properties/launchSettings.json index ee45c40..7ba0b74 100644 --- a/src/Alive.Net.Example/Properties/launchSettings.json +++ b/src/Alive.Net.Example/Properties/launchSettings.json @@ -3,7 +3,7 @@ "windowsAuthentication": false, "anonymousAuthentication": true, "iisExpress": { - "applicationUrl": "http://localhost:6445/", + "applicationUrl": "http://localhost:55653/", "sslPort": 0 } }, @@ -12,13 +12,15 @@ "commandName": "IISExpress", "launchBrowser": true, "environmentVariables": { - "Hosting:Environment": "Development" + "ASPNETCORE_ENVIRONMENT": "Development" } }, - "web": { - "commandName": "web", + "Alive.Net.Example": { + "commandName": "Project", + "launchBrowser": true, + "launchUrl": "http://localhost:5000", "environmentVariables": { - "Hosting:Environment": "Development" + "ASPNETCORE_ENVIRONMENT": "Development" } } } diff --git a/src/Alive.Net.Example/Startup.cs b/src/Alive.Net.Example/Startup.cs index 91e19dc..c3328bf 100644 --- a/src/Alive.Net.Example/Startup.cs +++ b/src/Alive.Net.Example/Startup.cs @@ -2,8 +2,8 @@ using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; -using Microsoft.AspNet.Builder; -using Microsoft.AspNet.Hosting; +using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; @@ -14,14 +14,15 @@ namespace Alive.Net.Example { public Startup(IHostingEnvironment env) { - // Set up configuration sources. var builder = new ConfigurationBuilder() - .AddJsonFile("appsettings.json") + .SetBasePath(env.ContentRootPath) + .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true) + .AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true) .AddEnvironmentVariables(); Configuration = builder.Build(); } - public IConfigurationRoot Configuration { get; set; } + public IConfigurationRoot Configuration { get; } // This method gets called by the runtime. Use this method to add services to the container. public void ConfigureServices(IServiceCollection services) @@ -36,37 +37,30 @@ namespace Alive.Net.Example loggerFactory.AddConsole(Configuration.GetSection("Logging")); loggerFactory.AddDebug(); - if(env.IsDevelopment()) + if (env.IsDevelopment()) { - app.UseBrowserLink(); app.UseDeveloperExceptionPage(); + app.UseBrowserLink(); } else { app.UseExceptionHandler("/Home/Error"); } - app.UseAlive(a => - { - a.BodyText = "Im awesome"; - a.StatusCode = System.Net.HttpStatusCode.OK; - a.LivecheckPath = new Microsoft.AspNet.Http.PathString("/CustomLivecheck"); - }); - app.UseAlive(a => a.OnLivecheckResponse = (response) => - { - if(true) - { - response.BodyText = "awesome"; - response.StatusCode = System.Net.HttpStatusCode.BadGateway; - } - else - { - response.BodyText = "awesome"; - response.StatusCode = System.Net.HttpStatusCode.OK; - } - }); - app.UseIISPlatformHandler(); - - app.UseStaticFiles(); + //app.UseAlive(a => + //{ + // a.BodyText = "Im awesome"; + // a.StatusCode = System.Net.HttpStatusCode.OK; + // a.LivecheckPath = new Microsoft.AspNetCore.Http.PathString("/CustomLivecheck"); + //}); + //app.UseAlive(a => a.OnLivecheckResponse = (response) => + //{ + // if(true) + // { + // response.BodyText = "awesome"; + // response.StatusCode = System.Net.HttpStatusCode.BadGateway; + // } + //}); + app.UseStaticFiles(); app.UseMvc(routes => { @@ -75,8 +69,5 @@ namespace Alive.Net.Example template: "{controller=Home}/{action=Index}/{id?}"); }); } - - // Entry point for the application. - public static void Main(string[] args) => WebApplication.Run(args); } -} \ No newline at end of file +} diff --git a/src/Alive.Net.Example/Views/Home/Index.cshtml b/src/Alive.Net.Example/Views/Home/Index.cshtml index 26e337f..3cd243d 100644 --- a/src/Alive.Net.Example/Views/Home/Index.cshtml +++ b/src/Alive.Net.Example/Views/Home/Index.cshtml @@ -11,44 +11,44 @@