diff --git a/src/Microsoft.AspNet.Diagnostics.Entity/Properties/Strings.Designer.cs b/src/Microsoft.AspNet.Diagnostics.Entity/Properties/Strings.Designer.cs index 9336c06e33..e81f55e58c 100644 --- a/src/Microsoft.AspNet.Diagnostics.Entity/Properties/Strings.Designer.cs +++ b/src/Microsoft.AspNet.Diagnostics.Entity/Properties/Strings.Designer.cs @@ -75,7 +75,7 @@ namespace Microsoft.AspNet.Diagnostics.Entity } /// - /// > k ef migration add [migration name] + /// > dnx . ef migration add [migration name] /// internal static string DatabaseErrorPage_AddMigrationCommand { @@ -83,7 +83,7 @@ namespace Microsoft.AspNet.Diagnostics.Entity } /// - /// > k ef migration add [migration name] + /// > dnx . ef migration add [migration name] /// internal static string FormatDatabaseErrorPage_AddMigrationCommand() { @@ -203,7 +203,7 @@ namespace Microsoft.AspNet.Diagnostics.Entity } /// - /// > k ef migration apply + /// > dnx . ef migration apply /// internal static string DatabaseErrorPage_ApplyMigrationsCommand { @@ -211,7 +211,7 @@ namespace Microsoft.AspNet.Diagnostics.Entity } /// - /// > k ef migration apply + /// > dnx . ef migration apply /// internal static string FormatDatabaseErrorPage_ApplyMigrationsCommand() { diff --git a/src/Microsoft.AspNet.Diagnostics/Properties/Resources.Designer.cs b/src/Microsoft.AspNet.Diagnostics/Properties/Resources.Designer.cs index f94f0951a8..8a2361a773 100644 --- a/src/Microsoft.AspNet.Diagnostics/Properties/Resources.Designer.cs +++ b/src/Microsoft.AspNet.Diagnostics/Properties/Resources.Designer.cs @@ -586,6 +586,118 @@ namespace Microsoft.AspNet.Diagnostics return GetString("ErrorPageHtml_CompilationException"); } + /// + /// Operating System: + /// + internal static string RuntimeInfoPage_OperatingSystem + { + get { return GetString("RuntimeInfoPage_OperatingSystem"); } + } + + /// + /// Operating System: + /// + internal static string FormatRuntimeInfoPage_OperatingSystem() + { + return GetString("RuntimeInfoPage_OperatingSystem"); + } + + /// + /// Runtime Architecture: + /// + internal static string RuntimeInfoPage_RuntimeArchitecture + { + get { return GetString("RuntimeInfoPage_RuntimeArchitecture"); } + } + + /// + /// Runtime Architecture: + /// + internal static string FormatRuntimeInfoPage_RuntimeArchitecture() + { + return GetString("RuntimeInfoPage_RuntimeArchitecture"); + } + + /// + /// Runtime Type: + /// + internal static string RuntimeInfoPage_RuntimeType + { + get { return GetString("RuntimeInfoPage_RuntimeType"); } + } + + /// + /// Runtime Type: + /// + internal static string FormatRuntimeInfoPage_RuntimeType() + { + return GetString("RuntimeInfoPage_RuntimeType"); + } + + /// + /// Could not determine the operating system. + /// + internal static string RuntimeInfoPage_OperatingSystemFail + { + get { return GetString("RuntimeInfoPage_OperatingSystemFail"); } + } + + /// + /// Could not determine the operating system. + /// + internal static string FormatRuntimeInfoPage_OperatingSystemFail() + { + return GetString("RuntimeInfoPage_OperatingSystemFail"); + } + + /// + /// Could not determine the runtime architecture. + /// + internal static string RuntimeInfoPage_RuntimeArchitectureFail + { + get { return GetString("RuntimeInfoPage_RuntimeArchitectureFail"); } + } + + /// + /// Could not determine the runtime architecture. + /// + internal static string FormatRuntimeInfoPage_RuntimeArchitectureFail() + { + return GetString("RuntimeInfoPage_RuntimeArchitectureFail"); + } + + /// + /// Could not determine the runtime type. + /// + internal static string RuntimeInfoPage_RuntimeTypeFail + { + get { return GetString("RuntimeInfoPage_RuntimeTypeFail"); } + } + + /// + /// Could not determine the runtime type. + /// + internal static string FormatRuntimeInfoPage_RuntimeTypeFail() + { + return GetString("RuntimeInfoPage_RuntimeTypeFail"); + } + + /// + /// Environment: + /// + internal static string RuntimeInfoPage_Environment + { + get { return GetString("RuntimeInfoPage_Environment"); } + } + + /// + /// Environment: + /// + internal static string FormatRuntimeInfoPage_Environment() + { + return GetString("RuntimeInfoPage_Environment"); + } + private static string GetString(string name, params string[] formatterNames) { var value = _resourceManager.GetString(name); diff --git a/src/Microsoft.AspNet.Diagnostics/Resources.resx b/src/Microsoft.AspNet.Diagnostics/Resources.resx index ff0a618e83..ca9ea34e6e 100644 --- a/src/Microsoft.AspNet.Diagnostics/Resources.resx +++ b/src/Microsoft.AspNet.Diagnostics/Resources.resx @@ -233,4 +233,25 @@ An error occurred during the compilation of a resource required to process this request. Please review the following specific error details and modify your source code appropriately. + + Operating System: + + + Runtime Architecture: + + + Runtime Type: + + + Could not determine the operating system. + + + Could not determine the runtime architecture. + + + Could not determine the runtime type. + + + Environment: + \ No newline at end of file diff --git a/src/Microsoft.AspNet.Diagnostics/RuntimeInfoExtensions.cs b/src/Microsoft.AspNet.Diagnostics/RuntimeInfoExtensions.cs index a83a18d7dc..7197e975e2 100644 --- a/src/Microsoft.AspNet.Diagnostics/RuntimeInfoExtensions.cs +++ b/src/Microsoft.AspNet.Diagnostics/RuntimeInfoExtensions.cs @@ -25,7 +25,8 @@ namespace Microsoft.AspNet.Builder [NotNull] RuntimeInfoPageOptions options) { var libraryManager = builder.ApplicationServices.GetService(typeof(ILibraryManager)) as ILibraryManager; - return builder.Use(next => new RuntimeInfoMiddleware(next, options, libraryManager).Invoke); + var runtimeEnvironment = builder.ApplicationServices.GetService(typeof(IRuntimeEnvironment)) as IRuntimeEnvironment; + return builder.Use(next => new RuntimeInfoMiddleware(next, options, libraryManager, runtimeEnvironment).Invoke); } } } \ No newline at end of file diff --git a/src/Microsoft.AspNet.Diagnostics/RuntimeInfoMiddleware.cs b/src/Microsoft.AspNet.Diagnostics/RuntimeInfoMiddleware.cs index de3ee8d286..b37985201f 100644 --- a/src/Microsoft.AspNet.Diagnostics/RuntimeInfoMiddleware.cs +++ b/src/Microsoft.AspNet.Diagnostics/RuntimeInfoMiddleware.cs @@ -1,15 +1,12 @@ // Copyright (c) Microsoft Open Technologies, Inc. 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.AspNet.Builder; using Microsoft.AspNet.Diagnostics.Views; using Microsoft.AspNet.Http; -using Microsoft.Framework.Runtime; -using System.Linq; -using System.Reflection; using Microsoft.Framework.Internal; +using Microsoft.Framework.Runtime; namespace Microsoft.AspNet.Diagnostics { @@ -21,6 +18,7 @@ namespace Microsoft.AspNet.Diagnostics private readonly RequestDelegate _next; private readonly RuntimeInfoPageOptions _options; private readonly ILibraryManager _libraryManager; + private readonly IRuntimeEnvironment _runtimeEnvironment; /// /// Initializes a new instance of the class @@ -30,11 +28,13 @@ namespace Microsoft.AspNet.Diagnostics public RuntimeInfoMiddleware( [NotNull] RequestDelegate next, [NotNull] RuntimeInfoPageOptions options, - [NotNull] ILibraryManager libraryManager) + [NotNull] ILibraryManager libraryManager, + [NotNull] IRuntimeEnvironment runtimeEnvironment) { _next = next; _options = options; _libraryManager = libraryManager; + _runtimeEnvironment = runtimeEnvironment; } /// @@ -59,16 +59,11 @@ namespace Microsoft.AspNet.Diagnostics { var model = new RuntimeInfoPageModel(); model.References = _libraryManager.GetLibraries(); - model.Version = GetRuntimeVersion(); - + model.Version = _runtimeEnvironment.RuntimeVersion; + model.OperatingSystem = _runtimeEnvironment.OperatingSystem; + model.RuntimeType = _runtimeEnvironment.RuntimeType; + model.RuntimeArchitecture = _runtimeEnvironment.RuntimeArchitecture; return model; } - - private static string GetRuntimeVersion() - { - var klr = Assembly.Load(new AssemblyName("dnx.host")); - var version = klr.GetCustomAttribute(); - return version?.InformationalVersion; - } } -} +} \ No newline at end of file diff --git a/src/Microsoft.AspNet.Diagnostics/Views/RuntimeInfoPage.cs b/src/Microsoft.AspNet.Diagnostics/Views/RuntimeInfoPage.cs index b62ed1ccd6..fd7149b6aa 100644 --- a/src/Microsoft.AspNet.Diagnostics/Views/RuntimeInfoPage.cs +++ b/src/Microsoft.AspNet.Diagnostics/Views/RuntimeInfoPage.cs @@ -70,32 +70,74 @@ using Microsoft.Framework.Runtime; #line default #line hidden WriteLiteral("\r\n \r" + -"\n\r\n\r\n

"); +"\n\r\n\r\n

"); #line 27 "RuntimeInfoPage.cshtml" - Write(Resources.RuntimeInfoPage_RuntimeVersion); + Write(Resources.RuntimeInfoPage_Environment); #line default #line hidden - WriteLiteral("

\r\n

"); + WriteLiteral("

\r\n

"); #line 28 "RuntimeInfoPage.cshtml" - Write(string.IsNullOrWhiteSpace(Model.Version) ? Resources.RuntimeInfoPage_RuntimeVersionFail : Model.Version); + Write(Resources.RuntimeInfoPage_OperatingSystem); #line default #line hidden - WriteLiteral("\r\n \r\n

"); + WriteLiteral(" "); +#line 28 "RuntimeInfoPage.cshtml" + Write(string.IsNullOrWhiteSpace(Model.OperatingSystem) ? Resources.RuntimeInfoPage_OperatingSystemFail : Model.OperatingSystem); + +#line default +#line hidden + WriteLiteral("

\r\n \r\n

"); #line 30 "RuntimeInfoPage.cshtml" + Write(Resources.RuntimeInfoPage_RuntimeVersion); + +#line default +#line hidden + WriteLiteral(" "); +#line 30 "RuntimeInfoPage.cshtml" + Write(string.IsNullOrWhiteSpace(Model.Version) ? Resources.RuntimeInfoPage_RuntimeVersionFail : Model.Version); + +#line default +#line hidden + WriteLiteral("

\r\n\r\n

"); +#line 32 "RuntimeInfoPage.cshtml" + Write(Resources.RuntimeInfoPage_RuntimeArchitecture); + +#line default +#line hidden + WriteLiteral(" "); +#line 32 "RuntimeInfoPage.cshtml" + Write(string.IsNullOrWhiteSpace(Model.RuntimeArchitecture) ? Resources.RuntimeInfoPage_RuntimeArchitectureFail : Model.RuntimeArchitecture); + +#line default +#line hidden + WriteLiteral("

\r\n\r\n

"); +#line 34 "RuntimeInfoPage.cshtml" + Write(Resources.RuntimeInfoPage_RuntimeType); + +#line default +#line hidden + WriteLiteral(" "); +#line 34 "RuntimeInfoPage.cshtml" + Write(string.IsNullOrWhiteSpace(Model.RuntimeType) ? Resources.RuntimeInfoPage_RuntimeTypeFail : Model.RuntimeType); + +#line default +#line hidden + WriteLiteral("

\r\n \r\n

"); +#line 36 "RuntimeInfoPage.cshtml" Write(Resources.RuntimeInfoPage_Packages); #line default #line hidden - WriteLiteral("

\r\n"); -#line 31 "RuntimeInfoPage.cshtml" + WriteLiteral("\r\n"); +#line 37 "RuntimeInfoPage.cshtml" #line default #line hidden -#line 31 "RuntimeInfoPage.cshtml" +#line 37 "RuntimeInfoPage.cshtml" if (@Resources.RuntimeInfoPage_Packages == null) { @@ -103,13 +145,13 @@ using Microsoft.Framework.Runtime; #line hidden WriteLiteral("

"); -#line 33 "RuntimeInfoPage.cshtml" +#line 39 "RuntimeInfoPage.cshtml" Write(Resources.RuntimeInfoPage_PackagesFail); #line default #line hidden WriteLiteral("

\r\n"); -#line 34 "RuntimeInfoPage.cshtml" +#line 40 "RuntimeInfoPage.cshtml" } else { @@ -119,44 +161,44 @@ using Microsoft.Framework.Runtime; WriteLiteral(" \r\n \r\n \r\n <" + "th>"); -#line 40 "RuntimeInfoPage.cshtml" +#line 46 "RuntimeInfoPage.cshtml" Write(Resources.RuntimeInfoPage_PackageNameColumnName); #line default #line hidden WriteLiteral("\r\n \r\n \r\n \r\n \r\n \r\n"); -#line 46 "RuntimeInfoPage.cshtml" +#line 52 "RuntimeInfoPage.cshtml" #line default #line hidden -#line 46 "RuntimeInfoPage.cshtml" +#line 52 "RuntimeInfoPage.cshtml" bool even = false; #line default #line hidden WriteLiteral("\r\n"); -#line 47 "RuntimeInfoPage.cshtml" +#line 53 "RuntimeInfoPage.cshtml" #line default #line hidden -#line 47 "RuntimeInfoPage.cshtml" +#line 53 "RuntimeInfoPage.cshtml" foreach (var package in Model.References.OrderBy(package => package.Name.ToLowerInvariant())) { @@ -164,40 +206,40 @@ using Microsoft.Framework.Runtime; #line hidden WriteLiteral(" (even?"even":"odd", 1584), false)); + WriteAttribute("class", Tuple.Create(" class=\"", 2160), Tuple.Create("\"", 2188), + Tuple.Create(Tuple.Create("", 2168), Tuple.Create(even?"even":"odd", 2168), false)); WriteLiteral(">\r\n \r\n \r\n \r\n \r\n"); -#line 54 "RuntimeInfoPage.cshtml" +#line 60 "RuntimeInfoPage.cshtml" #line default #line hidden -#line 54 "RuntimeInfoPage.cshtml" +#line 60 "RuntimeInfoPage.cshtml" even = !even; #line default #line hidden -#line 54 "RuntimeInfoPage.cshtml" +#line 60 "RuntimeInfoPage.cshtml" } @@ -205,7 +247,7 @@ using Microsoft.Framework.Runtime; #line hidden WriteLiteral(" \r\n
"); -#line 41 "RuntimeInfoPage.cshtml" +#line 47 "RuntimeInfoPage.cshtml" Write(Resources.RuntimeInfoPage_PackageVersionColumnName); #line default #line hidden WriteLiteral(""); -#line 42 "RuntimeInfoPage.cshtml" +#line 48 "RuntimeInfoPage.cshtml" Write(Resources.RuntimeInfoPage_PackagePathColumnName); #line default #line hidden WriteLiteral("
"); -#line 50 "RuntimeInfoPage.cshtml" +#line 56 "RuntimeInfoPage.cshtml" Write(package.Name); #line default #line hidden WriteLiteral(""); -#line 51 "RuntimeInfoPage.cshtml" +#line 57 "RuntimeInfoPage.cshtml" Write(package.Version); #line default #line hidden WriteLiteral(""); -#line 52 "RuntimeInfoPage.cshtml" +#line 58 "RuntimeInfoPage.cshtml" Write(package.Path); #line default #line hidden WriteLiteral("
\r\n"); -#line 58 "RuntimeInfoPage.cshtml" +#line 64 "RuntimeInfoPage.cshtml" } #line default diff --git a/src/Microsoft.AspNet.Diagnostics/Views/RuntimeInfoPage.cshtml b/src/Microsoft.AspNet.Diagnostics/Views/RuntimeInfoPage.cshtml index 5736c9e9fd..b46b74647b 100644 --- a/src/Microsoft.AspNet.Diagnostics/Views/RuntimeInfoPage.cshtml +++ b/src/Microsoft.AspNet.Diagnostics/Views/RuntimeInfoPage.cshtml @@ -24,10 +24,16 @@ -

@Resources.RuntimeInfoPage_RuntimeVersion

-

@(string.IsNullOrWhiteSpace(Model.Version) ? Resources.RuntimeInfoPage_RuntimeVersionFail : Model.Version)

+

@Resources.RuntimeInfoPage_Environment

+

@Resources.RuntimeInfoPage_OperatingSystem @(string.IsNullOrWhiteSpace(Model.OperatingSystem) ? Resources.RuntimeInfoPage_OperatingSystemFail : Model.OperatingSystem)

-

@Resources.RuntimeInfoPage_Packages

+

@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)

+ +

@Resources.RuntimeInfoPage_Packages

@if (@Resources.RuntimeInfoPage_Packages == null) {

@Resources.RuntimeInfoPage_PackagesFail

diff --git a/src/Microsoft.AspNet.Diagnostics/Views/RuntimeInfoPageModel.cs b/src/Microsoft.AspNet.Diagnostics/Views/RuntimeInfoPageModel.cs index 5c2451d807..95efbd8401 100644 --- a/src/Microsoft.AspNet.Diagnostics/Views/RuntimeInfoPageModel.cs +++ b/src/Microsoft.AspNet.Diagnostics/Views/RuntimeInfoPageModel.cs @@ -1,9 +1,7 @@ // Copyright (c) Microsoft Open Technologies, Inc. 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.Collections.Generic; -using Microsoft.AspNet.Http; using Microsoft.Framework.Runtime; namespace Microsoft.AspNet.Diagnostics.Views @@ -12,6 +10,12 @@ namespace Microsoft.AspNet.Diagnostics.Views { public string Version { get; internal set; } + public string OperatingSystem { get; internal set; } + + public string RuntimeArchitecture { get; internal set; } + + public string RuntimeType { get; internal set; } + public IEnumerable References { get; internal set; } } } \ No newline at end of file diff --git a/src/PageGenerator/Program.cs b/src/PageGenerator/Program.cs index 10fc0db9ee..8d6dce8e8b 100644 --- a/src/PageGenerator/Program.cs +++ b/src/PageGenerator/Program.cs @@ -54,9 +54,6 @@ namespace PageGenerator Console.WriteLine(); Console.WriteLine("{0} files successfully generated.", fileCount); Console.WriteLine(); - - Console.Write("Press enter to close application..."); - Console.ReadLine(); } private static IEnumerable GetCshtmlFiles(string path) diff --git a/test/Microsoft.AspNet.Diagnostics.Tests/RuntimeInfoMiddlewareTest.cs b/test/Microsoft.AspNet.Diagnostics.Tests/RuntimeInfoMiddlewareTest.cs index fb33c54c11..9f14bfaf2b 100644 --- a/test/Microsoft.AspNet.Diagnostics.Tests/RuntimeInfoMiddlewareTest.cs +++ b/test/Microsoft.AspNet.Diagnostics.Tests/RuntimeInfoMiddlewareTest.cs @@ -46,6 +46,12 @@ namespace Microsoft.AspNet.Diagnostics.Tests var libraryManagerMock = new Mock(MockBehavior.Strict); libraryManagerMock.Setup(l => l.GetLibraries()).Returns(libraries); + var runtimeEnvironmentMock = new Mock(MockBehavior.Strict); + runtimeEnvironmentMock.Setup(r => r.OperatingSystem).Returns("Windows"); + runtimeEnvironmentMock.Setup(r => r.RuntimeArchitecture).Returns("x64"); + runtimeEnvironmentMock.Setup(r => r.RuntimeType).Returns("clr"); + runtimeEnvironmentMock.Setup(r => r.RuntimeVersion).Returns("1.0.0"); + RequestDelegate next = _ => { return Task.FromResult(null); @@ -54,13 +60,17 @@ namespace Microsoft.AspNet.Diagnostics.Tests var middleware = new RuntimeInfoMiddleware( next, new RuntimeInfoPageOptions(), - libraryManagerMock.Object); + libraryManagerMock.Object, + runtimeEnvironmentMock.Object); // Act var model = middleware.CreateRuntimeInfoModel(); // Assert - Assert.False(string.IsNullOrWhiteSpace(model.Version)); + Assert.Equal("1.0.0", model.Version); + Assert.Equal("Windows", model.OperatingSystem); + Assert.Equal("clr", model.RuntimeType); + Assert.Equal("x64", model.RuntimeArchitecture); Assert.Same(libraries, model.References); } @@ -69,6 +79,7 @@ namespace Microsoft.AspNet.Diagnostics.Tests { // Arrange var libraryManagerMock = new Mock(MockBehavior.Strict); + var runtimeEnvironmentMock = new Mock(MockBehavior.Strict); RequestDelegate next = _ => { @@ -78,7 +89,8 @@ namespace Microsoft.AspNet.Diagnostics.Tests var middleware = new RuntimeInfoMiddleware( next, new RuntimeInfoPageOptions(), - libraryManagerMock.Object); + libraryManagerMock.Object, + runtimeEnvironmentMock.Object); var contextMock = new Mock(MockBehavior.Strict); contextMock @@ -102,6 +114,12 @@ namespace Microsoft.AspNet.Diagnostics.Tests new FakeLibraryInformation() { Name ="LibInfo2", Version = "1.0.0-beta2", Path = "Path2" }, }); + var runtimeEnvironmentMock = new Mock(MockBehavior.Strict); + runtimeEnvironmentMock.Setup(r => r.OperatingSystem).Returns("Windows"); + runtimeEnvironmentMock.Setup(r => r.RuntimeArchitecture).Returns("x64"); + runtimeEnvironmentMock.Setup(r => r.RuntimeType).Returns("clr"); + runtimeEnvironmentMock.Setup(r => r.RuntimeVersion).Returns("1.0.0"); + RequestDelegate next = _ => { return Task.FromResult(null); @@ -110,7 +128,8 @@ namespace Microsoft.AspNet.Diagnostics.Tests var middleware = new RuntimeInfoMiddleware( next, new RuntimeInfoPageOptions(), - libraryManagerMock.Object); + libraryManagerMock.Object, + runtimeEnvironmentMock.Object); var buffer = new byte[4096]; using (var responseStream = new MemoryStream(buffer)) @@ -132,12 +151,16 @@ namespace Microsoft.AspNet.Diagnostics.Tests // Assert string response = Encoding.UTF8.GetString(buffer); - Assert.True(response.Contains("LibInfo1")); - Assert.True(response.Contains("1.0.0-beta1")); - Assert.True(response.Contains("Path1")); - Assert.True(response.Contains("LibInfo2")); - Assert.True(response.Contains("1.0.0-beta2")); - Assert.True(response.Contains("Path2")); + Assert.Contains("

Runtime Version: 1.0.0

", response); + Assert.Contains("

Operating System: Windows

", response); + Assert.Contains("

Runtime Architecture: x64

", response); + Assert.Contains("

Runtime Type: clr

", response); + Assert.Contains("LibInfo1", response); + Assert.Contains("1.0.0-beta1", response); + Assert.Contains("Path1", response); + Assert.Contains("LibInfo2", response); + Assert.Contains("1.0.0-beta2", response); + Assert.Contains("Path2", response); } } @@ -150,6 +173,12 @@ namespace Microsoft.AspNet.Diagnostics.Tests new FakeLibraryInformation() { Name ="LibInfo1", Version = "1.0.0-beta1", Path = "Path1" }, }); + var runtimeEnvironmentMock = new Mock(MockBehavior.Strict); + runtimeEnvironmentMock.Setup(r => r.OperatingSystem).Returns("Windows"); + runtimeEnvironmentMock.Setup(r => r.RuntimeArchitecture).Returns("x64"); + runtimeEnvironmentMock.Setup(r => r.RuntimeType).Returns("clr"); + runtimeEnvironmentMock.Setup(r => r.RuntimeVersion).Returns("1.0.0"); + RequestDelegate next = _ => { return Task.FromResult(null); @@ -158,7 +187,8 @@ namespace Microsoft.AspNet.Diagnostics.Tests var middleware = new RuntimeInfoMiddleware( next, new RuntimeInfoPageOptions(), - libraryManagerMock.Object); + libraryManagerMock.Object, + runtimeEnvironmentMock.Object); var buffer = new byte[4096]; using (var responseStream = new MemoryStream(buffer))