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\r\n\r\n \r\n ");
-#line 24 "RuntimeInfoPage.cshtml"
- Write(Resources.RuntimeInfoPage_Title);
-
-#line default
-#line hidden
- WriteLiteral("\r\n \r\n\r\n\r\n ");
-#line 30 "RuntimeInfoPage.cshtml"
- Write(Resources.RuntimeInfoPage_Environment);
-
-#line default
-#line hidden
- WriteLiteral("
\r\n ");
-#line 31 "RuntimeInfoPage.cshtml"
- Write(Resources.RuntimeInfoPage_OperatingSystem);
-
-#line default
-#line hidden
- WriteLiteral(" ");
-#line 31 "RuntimeInfoPage.cshtml"
- Write(string.IsNullOrWhiteSpace(Model.OperatingSystem) ? Resources.RuntimeInfoPage_OperatingSystemFail : Model.OperatingSystem);
-
-#line default
-#line hidden
- WriteLiteral("
\r\n\r\n ");
-#line 33 "RuntimeInfoPage.cshtml"
- Write(Resources.RuntimeInfoPage_RuntimeVersion);
-
-#line default
-#line hidden
- WriteLiteral(" ");
-#line 33 "RuntimeInfoPage.cshtml"
- Write(string.IsNullOrWhiteSpace(Model.Version) ? Resources.RuntimeInfoPage_RuntimeVersionFail : Model.Version);
-
-#line default
-#line hidden
- WriteLiteral("
\r\n\r\n ");
-#line 35 "RuntimeInfoPage.cshtml"
- Write(Resources.RuntimeInfoPage_RuntimeArchitecture);
-
-#line default
-#line hidden
- WriteLiteral(" ");
-#line 35 "RuntimeInfoPage.cshtml"
- Write(string.IsNullOrWhiteSpace(Model.RuntimeArchitecture) ? Resources.RuntimeInfoPage_RuntimeArchitectureFail : Model.RuntimeArchitecture);
-
-#line default
-#line hidden
- WriteLiteral("
\r\n\r\n ");
-#line 37 "RuntimeInfoPage.cshtml"
- Write(Resources.RuntimeInfoPage_RuntimeType);
-
-#line default
-#line hidden
- WriteLiteral(" ");
-#line 37 "RuntimeInfoPage.cshtml"
- Write(string.IsNullOrWhiteSpace(Model.RuntimeType) ? Resources.RuntimeInfoPage_RuntimeTypeFail : Model.RuntimeType);
-
-#line default
-#line hidden
- WriteLiteral("
\r\n\r\n\r\n");
- }
- #pragma warning restore 1998
- }
-}
diff --git a/src/Microsoft.AspNetCore.Diagnostics/RuntimeInfo/Views/RuntimeInfoPage.cshtml b/src/Microsoft.AspNetCore.Diagnostics/RuntimeInfo/Views/RuntimeInfoPage.cshtml
deleted file mode 100644
index d90bf3344b..0000000000
--- a/src/Microsoft.AspNetCore.Diagnostics/RuntimeInfo/Views/RuntimeInfoPage.cshtml
+++ /dev/null
@@ -1,39 +0,0 @@
-@using System
-@using System.Globalization
-@using System.Linq
-@using Microsoft.AspNetCore.Diagnostics
-@using Microsoft.AspNetCore.Diagnostics.Views
-@using Microsoft.Extensions.PlatformAbstractions;
-
-@functions
-{
- public RuntimeInfoPage(RuntimeInfoPageModel model)
- {
- Model = model;
- }
-
- public RuntimeInfoPageModel Model { get; set; }
-}
-@{
- Response.ContentType = "text/html; charset=utf-8";
-}
-
-
-
-
- @Resources.RuntimeInfoPage_Title
-
-
-
- @Resources.RuntimeInfoPage_Environment
- @Resources.RuntimeInfoPage_OperatingSystem @(string.IsNullOrWhiteSpace(Model.OperatingSystem) ? Resources.RuntimeInfoPage_OperatingSystemFail : Model.OperatingSystem)
-
- @Resources.RuntimeInfoPage_RuntimeVersion @(string.IsNullOrWhiteSpace(Model.Version) ? Resources.RuntimeInfoPage_RuntimeVersionFail : Model.Version)
-
- @Resources.RuntimeInfoPage_RuntimeArchitecture @(string.IsNullOrWhiteSpace(Model.RuntimeArchitecture) ? Resources.RuntimeInfoPage_RuntimeArchitectureFail : Model.RuntimeArchitecture)
-
- @Resources.RuntimeInfoPage_RuntimeType @(string.IsNullOrWhiteSpace(Model.RuntimeType) ? Resources.RuntimeInfoPage_RuntimeTypeFail : Model.RuntimeType)
-
-
diff --git a/src/Microsoft.AspNetCore.Diagnostics/RuntimeInfo/Views/RuntimeInfoPage.css b/src/Microsoft.AspNetCore.Diagnostics/RuntimeInfo/Views/RuntimeInfoPage.css
deleted file mode 100644
index 0cd3e73416..0000000000
--- a/src/Microsoft.AspNetCore.Diagnostics/RuntimeInfo/Views/RuntimeInfoPage.css
+++ /dev/null
@@ -1,29 +0,0 @@
-body {
- font-family: 'Segoe UI', Tahoma, Arial, Helvetica, sans-serif;
- font-size: .813em;
- line-height: 1.4em;
- color: #222;
-}
-
-h1, h2, h3, h4, h5, th {
- font-weight: 100;
-}
-
-h1 {
- color: #44525e;
- margin: 15px 0 15px 0;
-}
-
-h2 {
- margin: 10px 5px 0 0;
-}
-
-table .even{
- background-color: #f0f0f0;
-}
-
-th {
- font-size: 16px;
-}
-
-
diff --git a/src/Microsoft.AspNetCore.Diagnostics/RuntimeInfo/Views/RuntimeInfoPageModel.cs b/src/Microsoft.AspNetCore.Diagnostics/RuntimeInfo/Views/RuntimeInfoPageModel.cs
deleted file mode 100644
index a61620cdae..0000000000
--- a/src/Microsoft.AspNetCore.Diagnostics/RuntimeInfo/Views/RuntimeInfoPageModel.cs
+++ /dev/null
@@ -1,16 +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.
-
-namespace Microsoft.AspNetCore.Diagnostics.Views
-{
- public class RuntimeInfoPageModel
- {
- public string Version { get; internal set; }
-
- public string OperatingSystem { get; internal set; }
-
- public string RuntimeArchitecture { get; internal set; }
-
- public string RuntimeType { get; internal set; }
- }
-}
\ No newline at end of file
diff --git a/src/Microsoft.AspNetCore.DiagnosticsViewPage.Sources/Microsoft.AspNetCore.DiagnosticsViewPage.Sources.xproj b/src/Microsoft.AspNetCore.DiagnosticsViewPage.Sources/Microsoft.AspNetCore.DiagnosticsViewPage.Sources.xproj
index 3250bc3dcb..8637a65e8d 100644
--- a/src/Microsoft.AspNetCore.DiagnosticsViewPage.Sources/Microsoft.AspNetCore.DiagnosticsViewPage.Sources.xproj
+++ b/src/Microsoft.AspNetCore.DiagnosticsViewPage.Sources/Microsoft.AspNetCore.DiagnosticsViewPage.Sources.xproj
@@ -9,9 +9,8 @@
b9f08060-621f-4e1f-bda8-9c4ea107e08a
Microsoft.AspNetCore.DiagnosticsViewPage.Sources
..\..\artifacts\obj\$(MSBuildProjectName)
- ..\..\artifacts\bin\$(MSBuildProjectName)\
+ .\bin\
-
2.0
diff --git a/test/Microsoft.AspNetCore.Diagnostics.FunctionalTests/RuntimeInfoPageSampleTest.cs b/test/Microsoft.AspNetCore.Diagnostics.FunctionalTests/RuntimeInfoPageSampleTest.cs
deleted file mode 100644
index 79ae899b34..0000000000
--- a/test/Microsoft.AspNetCore.Diagnostics.FunctionalTests/RuntimeInfoPageSampleTest.cs
+++ /dev/null
@@ -1,38 +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.Net;
-using System.Net.Http;
-using System.Threading.Tasks;
-using Microsoft.Extensions.PlatformAbstractions;
-using Xunit;
-
-namespace Microsoft.AspNetCore.Diagnostics.FunctionalTests
-{
- public class RuntimeInfoPageSampleTest : IClassFixture>
- {
- public RuntimeInfoPageSampleTest(TestFixture fixture)
- {
- Client = fixture.Client;
- }
-
- public HttpClient Client { get; }
-
- [Fact]
- public async Task RuntimeInfoPage_ShowsInfo()
- {
- // Arrange
- var request = new HttpRequestMessage(HttpMethod.Get, "http://localhost/runtimeinfo");
-
- // Act
- var response = await Client.SendAsync(request);
-
- var os = PlatformServices.Default.Runtime.OperatingSystem;
-
- // Assert
- var body = await response.Content.ReadAsStringAsync();
- Assert.Equal(HttpStatusCode.OK, response.StatusCode);
- Assert.Contains($"Operating System: {os}", body);
- }
- }
-}
diff --git a/test/Microsoft.AspNetCore.Diagnostics.FunctionalTests/project.json b/test/Microsoft.AspNetCore.Diagnostics.FunctionalTests/project.json
index a118b3bd3b..4d2881d61d 100644
--- a/test/Microsoft.AspNetCore.Diagnostics.FunctionalTests/project.json
+++ b/test/Microsoft.AspNetCore.Diagnostics.FunctionalTests/project.json
@@ -10,16 +10,10 @@
"Microsoft.AspNetCore.TestHost": "1.0.0-*",
"Microsoft.AspNetCore.Testing": "1.0.0-*",
"MiddlewareAnalysisSample": "1.0.0",
- "RuntimeInfoPageSample": "1.0.0",
"StatusCodePagesSample": "1.0.0",
"WelcomePageSample": "1.0.0",
"xunit": "2.1.0"
},
- "exclude": [
- "wwwroot",
- "node_modules",
- "bower_components"
- ],
"frameworks": {
"netcoreapp1.0": {
"imports": [
@@ -40,9 +34,5 @@
}
},
"testRunner": "xunit",
- "publishExclude": [
- "**.user",
- "**.vspscc"
- ],
"version": "1.0.0-*"
}
\ No newline at end of file
diff --git a/test/Microsoft.AspNetCore.Diagnostics.Tests/RuntimeInfoMiddlewareTest.cs b/test/Microsoft.AspNetCore.Diagnostics.Tests/RuntimeInfoMiddlewareTest.cs
deleted file mode 100644
index c4e0990d07..0000000000
--- a/test/Microsoft.AspNetCore.Diagnostics.Tests/RuntimeInfoMiddlewareTest.cs
+++ /dev/null
@@ -1,96 +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.IO;
-using System.Text;
-using System.Threading.Tasks;
-using Microsoft.AspNetCore.Builder;
-using Microsoft.AspNetCore.Http;
-using Microsoft.Extensions.Options;
-using Microsoft.Extensions.PlatformAbstractions;
-using Moq;
-using Xunit;
-
-namespace Microsoft.AspNetCore.Diagnostics.Tests
-{
- public class RuntimeInfoMiddlewareTest
- {
- private const string DefaultPath = "/runtimeinfo";
-
- [Fact]
- public void DefaultPageOptions_HasDefaultPath()
- {
- // Arrange & act
- var options = new RuntimeInfoPageOptions();
-
- // Assert
- Assert.Equal(DefaultPath, options.Path.Value);
- }
-
- [Fact]
- public async void Invoke_WithNonMatchingPath_IgnoresRequest()
- {
- // Arrange
- RequestDelegate next = _ =>
- {
- return Task.FromResult