diff --git a/DiagnosticsPages.sln b/DiagnosticsPages.sln index 04ef092fbe..a54367bd78 100644 --- a/DiagnosticsPages.sln +++ b/DiagnosticsPages.sln @@ -1,6 +1,6 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 14 -VisualStudioVersion = 14.0.24720.0 +VisualStudioVersion = 14.0.25123.0 MinimumVisualStudioVersion = 10.0.40219.1 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{509A6F36-AD80-4A18-B5B1-717D38DFF29D}" EndProject @@ -19,8 +19,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution global.json = global.json EndProjectSection EndProject -Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "RuntimeInfoPageSample", "samples\RuntimeInfoPageSample\RuntimeInfoPageSample.xproj", "{CD62A191-39F5-4C86-BC1D-7731085120F5}" -EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{2AF90579-B118-4583-AE88-672EFACB5BC4}" EndProject Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.AspNetCore.Diagnostics.Tests", "test\Microsoft.AspNetCore.Diagnostics.Tests\Microsoft.AspNetCore.Diagnostics.Tests.xproj", "{994351B4-7B2A-4139-8B72-72C5BB5CC618}" @@ -103,16 +101,6 @@ Global {4D4A785A-ECB9-4916-A88F-0FD306EE3B74}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU {4D4A785A-ECB9-4916-A88F-0FD306EE3B74}.Release|Mixed Platforms.Build.0 = Release|Any CPU {4D4A785A-ECB9-4916-A88F-0FD306EE3B74}.Release|x86.ActiveCfg = Release|Any CPU - {CD62A191-39F5-4C86-BC1D-7731085120F5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {CD62A191-39F5-4C86-BC1D-7731085120F5}.Debug|Any CPU.Build.0 = Debug|Any CPU - {CD62A191-39F5-4C86-BC1D-7731085120F5}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {CD62A191-39F5-4C86-BC1D-7731085120F5}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {CD62A191-39F5-4C86-BC1D-7731085120F5}.Debug|x86.ActiveCfg = Debug|Any CPU - {CD62A191-39F5-4C86-BC1D-7731085120F5}.Release|Any CPU.ActiveCfg = Release|Any CPU - {CD62A191-39F5-4C86-BC1D-7731085120F5}.Release|Any CPU.Build.0 = Release|Any CPU - {CD62A191-39F5-4C86-BC1D-7731085120F5}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {CD62A191-39F5-4C86-BC1D-7731085120F5}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {CD62A191-39F5-4C86-BC1D-7731085120F5}.Release|x86.ActiveCfg = Release|Any CPU {994351B4-7B2A-4139-8B72-72C5BB5CC618}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {994351B4-7B2A-4139-8B72-72C5BB5CC618}.Debug|Any CPU.Build.0 = Debug|Any CPU {994351B4-7B2A-4139-8B72-72C5BB5CC618}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU @@ -298,7 +286,6 @@ Global {68A1F0E1-ECCE-46D1-B20F-C43EE5B097DE} = {509A6F36-AD80-4A18-B5B1-717D38DFF29D} {589AC17F-9455-4764-8F82-FCD2AE58DA14} = {ACAA0157-A8C4-4152-93DE-90CCDF304087} {4D4A785A-ECB9-4916-A88F-0FD306EE3B74} = {509A6F36-AD80-4A18-B5B1-717D38DFF29D} - {CD62A191-39F5-4C86-BC1D-7731085120F5} = {ACAA0157-A8C4-4152-93DE-90CCDF304087} {994351B4-7B2A-4139-8B72-72C5BB5CC618} = {2AF90579-B118-4583-AE88-672EFACB5BC4} {427CDB36-78B0-4583-9EBC-7F283DE60355} = {ACAA0157-A8C4-4152-93DE-90CCDF304087} {4F5A6A72-FFE4-49C4-B4C6-58132CFCB9FE} = {509A6F36-AD80-4A18-B5B1-717D38DFF29D} diff --git a/samples/RuntimeInfoPageSample/RuntimeInfoPageSample.xproj b/samples/RuntimeInfoPageSample/RuntimeInfoPageSample.xproj deleted file mode 100644 index 080676c6e8..0000000000 --- a/samples/RuntimeInfoPageSample/RuntimeInfoPageSample.xproj +++ /dev/null @@ -1,18 +0,0 @@ - - - - 14.0 - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - - - - cd62a191-39f5-4c86-bc1d-7731085120f5 - ..\..\artifacts\obj\$(MSBuildProjectName) - ..\..\artifacts\bin\ - - - 2.0 - 62670 - - - \ No newline at end of file diff --git a/samples/RuntimeInfoPageSample/Startup.cs b/samples/RuntimeInfoPageSample/Startup.cs deleted file mode 100644 index b668df0a64..0000000000 --- a/samples/RuntimeInfoPageSample/Startup.cs +++ /dev/null @@ -1,34 +0,0 @@ -using System.Threading.Tasks; -using Microsoft.AspNetCore.Builder; -using Microsoft.AspNetCore.Hosting; - -namespace RuntimeInfoPageSample -{ - public class Startup - { - public void Configure(IApplicationBuilder app) - { - app.UseRuntimeInfoPage(); - - app.Run(context => - { - context.Response.StatusCode = 302; - context.Response.Headers["Location"] = "/runtimeinfo"; - - return Task.FromResult(0); - }); - } - - public static void Main(string[] args) - { - var host = new WebHostBuilder() - .UseKestrel() - .UseIISIntegration() - .UseStartup() - .Build(); - - host.Run(); - } - } -} - diff --git a/samples/RuntimeInfoPageSample/project.json b/samples/RuntimeInfoPageSample/project.json deleted file mode 100644 index 4589e29f85..0000000000 --- a/samples/RuntimeInfoPageSample/project.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "dependencies": { - "Microsoft.NETCore.Platforms": "1.0.1-*", - "Microsoft.AspNetCore.Diagnostics": "1.0.0-*", - "Microsoft.AspNetCore.Server.IISIntegration": "1.0.0-*", - "Microsoft.AspNetCore.Server.Kestrel": "1.0.0-*" - }, - "buildOptions": { - "emitEntryPoint": true - }, - "frameworks": { - "net451": {}, - "netcoreapp1.0": { - "imports": [ - "dnxcore50" - ], - "dependencies": { - "Microsoft.NETCore.App": { - "version": "1.0.0-*", - "type": "platform" - } - } - } - }, - "publishOptions": { - "include": [ - "web.config" - ] - }, - "tools": { - "Microsoft.AspNetCore.Server.IISIntegration.Tools": { - "version": "1.0.0-*", - "imports": "portable-net45+wp80+win8+wpa81+dnxcore50" - } - }, - "scripts": { - "postpublish": "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" - } -} \ No newline at end of file diff --git a/samples/RuntimeInfoPageSample/web.config b/samples/RuntimeInfoPageSample/web.config deleted file mode 100644 index f7ac679334..0000000000 --- a/samples/RuntimeInfoPageSample/web.config +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/src/Microsoft.AspNetCore.Diagnostics.Elm/project.json b/src/Microsoft.AspNetCore.Diagnostics.Elm/project.json index 14bdb5dc36..a1f9dfe434 100644 --- a/src/Microsoft.AspNetCore.Diagnostics.Elm/project.json +++ b/src/Microsoft.AspNetCore.Diagnostics.Elm/project.json @@ -2,11 +2,11 @@ "version": "0.1.0-*", "description": "ASP.NET Core Error Logging Middleware (ELM) to capture and display request logs.", "buildOptions": { - "warningsAsErrors": true, "keyFile": "../../tools/Key.snk", "nowarn": [ "CS1591" ], + "warningsAsErrors": true, "xmlDoc": true }, "packOptions": { @@ -39,8 +39,5 @@ "System.Threading": "4.0.11-*" } } - }, - "compileExclude": [ - "Views/*.cshtml" - ] + } } \ No newline at end of file diff --git a/src/Microsoft.AspNetCore.Diagnostics/RuntimeInfo/RuntimeInfoExtensions.cs b/src/Microsoft.AspNetCore.Diagnostics/RuntimeInfo/RuntimeInfoExtensions.cs deleted file mode 100644 index 00a092c07a..0000000000 --- a/src/Microsoft.AspNetCore.Diagnostics/RuntimeInfo/RuntimeInfoExtensions.cs +++ /dev/null @@ -1,52 +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.Diagnostics; -using Microsoft.AspNetCore.Http; -using Microsoft.Extensions.Options; - -namespace Microsoft.AspNetCore.Builder -{ - public static class RuntimeInfoExtensions - { - public static IApplicationBuilder UseRuntimeInfoPage(this IApplicationBuilder app) - { - if (app == null) - { - throw new ArgumentNullException(nameof(app)); - } - - return app.UseMiddleware(); - } - - public static IApplicationBuilder UseRuntimeInfoPage(this IApplicationBuilder app, string path) - { - if (app == null) - { - throw new ArgumentNullException(nameof(app)); - } - - return app.UseRuntimeInfoPage(new RuntimeInfoPageOptions - { - Path = new PathString(path) - }); - } - - public static IApplicationBuilder UseRuntimeInfoPage( - this IApplicationBuilder app, - RuntimeInfoPageOptions options) - { - if (app == null) - { - throw new ArgumentNullException(nameof(app)); - } - if (options == null) - { - throw new ArgumentNullException(nameof(options)); - } - - return app.UseMiddleware(Options.Create(options)); - } - } -} diff --git a/src/Microsoft.AspNetCore.Diagnostics/RuntimeInfo/RuntimeInfoMiddleware.cs b/src/Microsoft.AspNetCore.Diagnostics/RuntimeInfo/RuntimeInfoMiddleware.cs deleted file mode 100644 index 46aa7c2e4b..0000000000 --- a/src/Microsoft.AspNetCore.Diagnostics/RuntimeInfo/RuntimeInfoMiddleware.cs +++ /dev/null @@ -1,74 +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.Threading.Tasks; -using Microsoft.AspNetCore.Builder; -using Microsoft.AspNetCore.Diagnostics.Views; -using Microsoft.AspNetCore.Http; -using Microsoft.Extensions.Options; -using Microsoft.Extensions.PlatformAbstractions; - -namespace Microsoft.AspNetCore.Diagnostics -{ - /// - /// Displays information about the packages used by the application at runtime - /// - public class RuntimeInfoMiddleware - { - private readonly RequestDelegate _next; - private readonly RuntimeInfoPageOptions _options; - - /// - /// Initializes a new instance of the class - /// - /// - /// - public RuntimeInfoMiddleware( - RequestDelegate next, - IOptions options) - { - if (next == null) - { - throw new ArgumentNullException(nameof(next)); - } - - if (options == null) - { - throw new ArgumentNullException(nameof(options)); - } - - _next = next; - _options = options.Value; - } - - /// - /// Process an individual request. - /// - /// - /// - public Task Invoke(HttpContext context) - { - var request = context.Request; - if (!_options.Path.HasValue || _options.Path == request.Path) - { - var model = CreateRuntimeInfoModel(); - var runtimeInfoPage = new RuntimeInfoPage(model); - return runtimeInfoPage.ExecuteAsync(context); - } - - return _next(context); - } - - private static RuntimeInfoPageModel CreateRuntimeInfoModel() - { - var model = new RuntimeInfoPageModel(); - var runtimeEnvironment = PlatformServices.Default.Runtime; - model.Version = runtimeEnvironment.RuntimeVersion; - model.OperatingSystem = runtimeEnvironment.OperatingSystem; - model.RuntimeType = runtimeEnvironment.RuntimeType; - model.RuntimeArchitecture = runtimeEnvironment.RuntimeArchitecture; - return model; - } - } -} \ No newline at end of file diff --git a/src/Microsoft.AspNetCore.Diagnostics/RuntimeInfo/RuntimeInfoPageOptions.cs b/src/Microsoft.AspNetCore.Diagnostics/RuntimeInfo/RuntimeInfoPageOptions.cs deleted file mode 100644 index f2d1b3cd8b..0000000000 --- a/src/Microsoft.AspNetCore.Diagnostics/RuntimeInfo/RuntimeInfoPageOptions.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 Microsoft.AspNetCore.Http; - -namespace Microsoft.AspNetCore.Builder -{ - /// - /// Options for the RuntimeInfoPage - /// - public class RuntimeInfoPageOptions - { - /// - /// Initializes a new instance of the class - /// - public RuntimeInfoPageOptions() - { - Path = new PathString("/runtimeinfo"); - } - - /// - /// Specifies which request path will be responded to. Exact match only. Set to null to handle all requests. - /// - public PathString Path { get; set; } - } -} \ No newline at end of file diff --git a/src/Microsoft.AspNetCore.Diagnostics/RuntimeInfo/Views/RuntimeInfoPage.cs b/src/Microsoft.AspNetCore.Diagnostics/RuntimeInfo/Views/RuntimeInfoPage.cs deleted file mode 100644 index e0dc0606ea..0000000000 --- a/src/Microsoft.AspNetCore.Diagnostics/RuntimeInfo/Views/RuntimeInfoPage.cs +++ /dev/null @@ -1,141 +0,0 @@ -namespace Microsoft.AspNetCore.Diagnostics.Views -{ -#line 1 "RuntimeInfoPage.cshtml" -using System - -#line default -#line hidden - ; -#line 2 "RuntimeInfoPage.cshtml" -using System.Globalization - -#line default -#line hidden - ; -#line 3 "RuntimeInfoPage.cshtml" -using System.Linq - -#line default -#line hidden - ; -#line 4 "RuntimeInfoPage.cshtml" -using Microsoft.AspNetCore.Diagnostics - -#line default -#line hidden - ; -#line 5 "RuntimeInfoPage.cshtml" -using Microsoft.AspNetCore.Diagnostics.Views - -#line default -#line hidden - ; -#line 6 "RuntimeInfoPage.cshtml" -using Microsoft.Extensions.PlatformAbstractions; - -#line default -#line hidden - using System.Threading.Tasks; - - public class RuntimeInfoPage : Microsoft.AspNetCore.DiagnosticsViewPage.Views.BaseView - { -#line 9 "RuntimeInfoPage.cshtml" - - public RuntimeInfoPage(RuntimeInfoPageModel model) - { - Model = model; - } - - public RuntimeInfoPageModel Model { get; set; } - -#line default -#line hidden - #line hidden - public RuntimeInfoPage() - { - } - - #pragma warning disable 1998 - public override async Task ExecuteAsync() - { - WriteLiteral("\r\n"); -#line 17 "RuntimeInfoPage.cshtml" - - Response.ContentType = "text/html; charset=utf-8"; - -#line default -#line hidden - - WriteLiteral("\r\n