diff --git a/src/Middleware/Diagnostics.Abstractions/src/DiagnosticMessage.cs b/src/Middleware/Diagnostics.Abstractions/src/DiagnosticMessage.cs index dc9f65f507..99f6a0f5d8 100644 --- a/src/Middleware/Diagnostics.Abstractions/src/DiagnosticMessage.cs +++ b/src/Middleware/Diagnostics.Abstractions/src/DiagnosticMessage.cs @@ -8,6 +8,16 @@ namespace Microsoft.AspNetCore.Diagnostics /// public class DiagnosticMessage { + /// + /// Initializes a new instance of . + /// + /// The error message. + /// The formatted error message. + /// The path of the file that produced the message. + /// The one-based line index for the start of the compilation error. + /// The zero-based column index for the start of the compilation error. + /// The one-based line index for the end of the compilation error. + /// The zero-based column index for the end of the compilation error. public DiagnosticMessage( string message, string formattedMessage, @@ -61,4 +71,4 @@ namespace Microsoft.AspNetCore.Diagnostics /// public string FormattedMessage { get; } } -} \ No newline at end of file +} diff --git a/src/Middleware/Diagnostics.Abstractions/src/IExceptionHandlerFeature.cs b/src/Middleware/Diagnostics.Abstractions/src/IExceptionHandlerFeature.cs index 23069e3df4..7e25bc6b7b 100644 --- a/src/Middleware/Diagnostics.Abstractions/src/IExceptionHandlerFeature.cs +++ b/src/Middleware/Diagnostics.Abstractions/src/IExceptionHandlerFeature.cs @@ -5,8 +5,14 @@ using System; namespace Microsoft.AspNetCore.Diagnostics { + /// + /// Represents a feature containing the error of the original request to be examined by an exception handler. + /// public interface IExceptionHandlerFeature { + /// + /// The error encountered during the original request + /// Exception Error { get; } } -} \ No newline at end of file +} diff --git a/src/Middleware/Diagnostics.Abstractions/src/IStatusCodeReExecuteFeature.cs b/src/Middleware/Diagnostics.Abstractions/src/IStatusCodeReExecuteFeature.cs index 31451e0bc7..994a69be74 100644 --- a/src/Middleware/Diagnostics.Abstractions/src/IStatusCodeReExecuteFeature.cs +++ b/src/Middleware/Diagnostics.Abstractions/src/IStatusCodeReExecuteFeature.cs @@ -1,14 +1,30 @@ // 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.Diagnostics { + /// + /// Represents a feature containing the path details of the original request. This feature is provided by the + /// StatusCodePagesMiddleware when it re-execute the request pipeline with an alternative path to generate the + /// response body. + /// public interface IStatusCodeReExecuteFeature { + /// + /// The of the original request. + /// string OriginalPathBase { get; set; } + /// + /// The of the original request. + /// string OriginalPath { get; set; } + /// + /// The of the original request. + /// string OriginalQueryString { get; set; } } -} \ No newline at end of file +} diff --git a/src/Middleware/Diagnostics.Abstractions/src/Microsoft.AspNetCore.Diagnostics.Abstractions.csproj b/src/Middleware/Diagnostics.Abstractions/src/Microsoft.AspNetCore.Diagnostics.Abstractions.csproj index 6b4d54af4f..b8c5508abf 100644 --- a/src/Middleware/Diagnostics.Abstractions/src/Microsoft.AspNetCore.Diagnostics.Abstractions.csproj +++ b/src/Middleware/Diagnostics.Abstractions/src/Microsoft.AspNetCore.Diagnostics.Abstractions.csproj @@ -4,7 +4,7 @@ ASP.NET Core diagnostics middleware abstractions and feature interface definitions. $(DefaultNetCoreTargetFramework) true - $(NoWarn);CS1591 + $(NoWarn.Replace('1591', '')) true aspnetcore;diagnostics false diff --git a/src/Middleware/Diagnostics/src/ExceptionHandler/ExceptionHandlerExtensions.cs b/src/Middleware/Diagnostics/src/ExceptionHandler/ExceptionHandlerExtensions.cs index 92f3c35765..7d3160f59e 100644 --- a/src/Middleware/Diagnostics/src/ExceptionHandler/ExceptionHandlerExtensions.cs +++ b/src/Middleware/Diagnostics/src/ExceptionHandler/ExceptionHandlerExtensions.cs @@ -8,6 +8,9 @@ using Microsoft.Extensions.Options; namespace Microsoft.AspNetCore.Builder { + /// + /// Extension methods for enabling . + /// public static class ExceptionHandlerExtensions { /// @@ -95,4 +98,4 @@ namespace Microsoft.AspNetCore.Builder return app.UseMiddleware(Options.Create(options)); } } -} \ No newline at end of file +} diff --git a/src/Middleware/Diagnostics/src/ExceptionHandler/ExceptionHandlerFeature.cs b/src/Middleware/Diagnostics/src/ExceptionHandler/ExceptionHandlerFeature.cs index f01fb6a1ab..fa43797a5d 100644 --- a/src/Middleware/Diagnostics/src/ExceptionHandler/ExceptionHandlerFeature.cs +++ b/src/Middleware/Diagnostics/src/ExceptionHandler/ExceptionHandlerFeature.cs @@ -5,10 +5,15 @@ using System; namespace Microsoft.AspNetCore.Diagnostics { + /// + /// A feature containing the path and error of the original request for examination by an exception handler. + /// public class ExceptionHandlerFeature : IExceptionHandlerPathFeature { + /// public Exception Error { get; set; } + /// public string Path { get; set; } } -} \ No newline at end of file +} diff --git a/src/Middleware/Diagnostics/src/ExceptionHandler/ExceptionHandlerMiddleware.cs b/src/Middleware/Diagnostics/src/ExceptionHandler/ExceptionHandlerMiddleware.cs index fbf0c8913d..d954e00a44 100644 --- a/src/Middleware/Diagnostics/src/ExceptionHandler/ExceptionHandlerMiddleware.cs +++ b/src/Middleware/Diagnostics/src/ExceptionHandler/ExceptionHandlerMiddleware.cs @@ -14,6 +14,9 @@ using Microsoft.Net.Http.Headers; namespace Microsoft.AspNetCore.Diagnostics { + /// + /// A middleware for handling exceptions in the application. + /// public class ExceptionHandlerMiddleware { private readonly RequestDelegate _next; @@ -22,6 +25,13 @@ namespace Microsoft.AspNetCore.Diagnostics private readonly Func _clearCacheHeadersDelegate; private readonly DiagnosticListener _diagnosticListener; + /// + /// Creates a new + /// + /// The representing the next middleware in the pipeline. + /// The used for logging. + /// The options for configuring the middleware. + /// The used for writing diagnostic messages. public ExceptionHandlerMiddleware( RequestDelegate next, ILoggerFactory loggerFactory, @@ -46,6 +56,10 @@ namespace Microsoft.AspNetCore.Diagnostics } } + /// + /// Executes the middleware. + /// + /// The for the current request. public Task Invoke(HttpContext context) { ExceptionDispatchInfo edi; diff --git a/src/Middleware/Diagnostics/src/ExceptionHandler/ExceptionHandlerOptions.cs b/src/Middleware/Diagnostics/src/ExceptionHandler/ExceptionHandlerOptions.cs index 65a2fb81e7..e5971ecd77 100644 --- a/src/Middleware/Diagnostics/src/ExceptionHandler/ExceptionHandlerOptions.cs +++ b/src/Middleware/Diagnostics/src/ExceptionHandler/ExceptionHandlerOptions.cs @@ -1,14 +1,26 @@ // 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.Diagnostics; using Microsoft.AspNetCore.Http; namespace Microsoft.AspNetCore.Builder { + /// + /// Options for configuring the . + /// public class ExceptionHandlerOptions { + /// + /// The path to the exception handling endpoint. This path will be used when executing + /// the . + /// public PathString ExceptionHandlingPath { get; set; } + /// + /// The that will handle the exception. If this is not + /// explicitly provided, the subsequent middleware pipeline will be used by default. + /// public RequestDelegate ExceptionHandler { get; set; } } -} \ No newline at end of file +} diff --git a/src/Middleware/Diagnostics/src/Microsoft.AspNetCore.Diagnostics.csproj b/src/Middleware/Diagnostics/src/Microsoft.AspNetCore.Diagnostics.csproj index 0656fcc9d7..1bf271a30c 100644 --- a/src/Middleware/Diagnostics/src/Microsoft.AspNetCore.Diagnostics.csproj +++ b/src/Middleware/Diagnostics/src/Microsoft.AspNetCore.Diagnostics.csproj @@ -4,7 +4,7 @@ ASP.NET Core middleware for exception handling, exception display pages, and diagnostics information. Includes developer exception page middleware, exception handler middleware, runtime info middleware, status code page middleware, and welcome page middleware $(DefaultNetCoreTargetFramework) true - $(NoWarn);CS1591 + $(NoWarn.Replace('1591', '')) true aspnetcore;diagnostics false diff --git a/src/Middleware/Diagnostics/src/StatusCodePage/StatusCodeContext.cs b/src/Middleware/Diagnostics/src/StatusCodePage/StatusCodeContext.cs index 849aee6994..3a8e9e60bb 100644 --- a/src/Middleware/Diagnostics/src/StatusCodePage/StatusCodeContext.cs +++ b/src/Middleware/Diagnostics/src/StatusCodePage/StatusCodeContext.cs @@ -6,8 +6,17 @@ using Microsoft.AspNetCore.Http; namespace Microsoft.AspNetCore.Diagnostics { + /// + /// Contains information used by the handler of the . + /// public class StatusCodeContext { + /// + /// Creates a new . + /// + /// The . + /// The configured . + /// The representing the next middleware in the pipeline. public StatusCodeContext(HttpContext context, StatusCodePagesOptions options, RequestDelegate next) { HttpContext = context; @@ -15,10 +24,19 @@ namespace Microsoft.AspNetCore.Diagnostics Next = next; } + /// + /// Gets the . + /// public HttpContext HttpContext { get; private set; } + /// + /// Gets the configured . + /// public StatusCodePagesOptions Options { get; private set; } + /// + /// Gets the representing the next middleware in the pipeline. + /// public RequestDelegate Next { get; private set; } } -} \ No newline at end of file +} diff --git a/src/Middleware/Diagnostics/src/StatusCodePage/StatusCodePagesExtensions.cs b/src/Middleware/Diagnostics/src/StatusCodePage/StatusCodePagesExtensions.cs index a7d54489d9..1f087b3f4c 100644 --- a/src/Middleware/Diagnostics/src/StatusCodePage/StatusCodePagesExtensions.cs +++ b/src/Middleware/Diagnostics/src/StatusCodePage/StatusCodePagesExtensions.cs @@ -11,6 +11,9 @@ using Microsoft.Extensions.Options; namespace Microsoft.AspNetCore.Builder { + /// + /// Extension methods for enabling . + /// public static class StatusCodePagesExtensions { /// diff --git a/src/Middleware/Diagnostics/src/StatusCodePage/StatusCodePagesFeature.cs b/src/Middleware/Diagnostics/src/StatusCodePage/StatusCodePagesFeature.cs index 093ca59521..86115969d3 100644 --- a/src/Middleware/Diagnostics/src/StatusCodePage/StatusCodePagesFeature.cs +++ b/src/Middleware/Diagnostics/src/StatusCodePage/StatusCodePagesFeature.cs @@ -8,6 +8,11 @@ namespace Microsoft.AspNetCore.Diagnostics /// public class StatusCodePagesFeature : IStatusCodePagesFeature { + /// + /// Enables or disables status code pages. The default value is true. + /// Set this to false to prevent the + /// from creating a response body while handling the error status code. + /// public bool Enabled { get; set; } = true; } -} \ No newline at end of file +} diff --git a/src/Middleware/Diagnostics/src/StatusCodePage/StatusCodePagesMiddleware.cs b/src/Middleware/Diagnostics/src/StatusCodePage/StatusCodePagesMiddleware.cs index fca9e4dec7..629c1a6437 100644 --- a/src/Middleware/Diagnostics/src/StatusCodePage/StatusCodePagesMiddleware.cs +++ b/src/Middleware/Diagnostics/src/StatusCodePage/StatusCodePagesMiddleware.cs @@ -9,11 +9,19 @@ using Microsoft.Extensions.Options; namespace Microsoft.AspNetCore.Diagnostics { + /// + /// A middleware for generating the response body of error status codes with no body. + /// public class StatusCodePagesMiddleware { private readonly RequestDelegate _next; private readonly StatusCodePagesOptions _options; + /// + /// Creates a new + /// + /// The representing the next middleware in the pipeline. + /// The options for configuring the middleware. public StatusCodePagesMiddleware(RequestDelegate next, IOptions options) { _next = next; @@ -24,6 +32,11 @@ namespace Microsoft.AspNetCore.Diagnostics } } + /// + /// Executes the middleware. + /// + /// The for the current request. + /// A task that represents the execution of this middleware. public async Task Invoke(HttpContext context) { var statusCodeFeature = new StatusCodePagesFeature(); @@ -52,4 +65,4 @@ namespace Microsoft.AspNetCore.Diagnostics await _options.HandleAsync(statusCodeContext); } } -} \ No newline at end of file +} diff --git a/src/Middleware/Diagnostics/src/StatusCodePage/StatusCodePagesOptions.cs b/src/Middleware/Diagnostics/src/StatusCodePage/StatusCodePagesOptions.cs index c5640c2250..56eb1958dd 100644 --- a/src/Middleware/Diagnostics/src/StatusCodePage/StatusCodePagesOptions.cs +++ b/src/Middleware/Diagnostics/src/StatusCodePage/StatusCodePagesOptions.cs @@ -11,10 +11,14 @@ using Microsoft.AspNetCore.WebUtilities; namespace Microsoft.AspNetCore.Builder { /// - /// Options for StatusCodePagesMiddleware. + /// Options for . /// public class StatusCodePagesOptions { + /// + /// Creates a default which produces a plaintext response + /// containing the status code and the reason phrase. + /// public StatusCodePagesOptions() { HandleAsync = context => @@ -43,6 +47,9 @@ namespace Microsoft.AspNetCore.Builder internetExplorerWorkaround); } + /// + /// The handler that generates the response body for the given . By default this produces a plain text response that includes the status code. + /// public Func HandleAsync { get; set; } } -} \ No newline at end of file +} diff --git a/src/Middleware/Diagnostics/src/StatusCodePage/StatusCodeReExecuteFeature.cs b/src/Middleware/Diagnostics/src/StatusCodePage/StatusCodeReExecuteFeature.cs index 8b25d24385..caed0a9d6b 100644 --- a/src/Middleware/Diagnostics/src/StatusCodePage/StatusCodeReExecuteFeature.cs +++ b/src/Middleware/Diagnostics/src/StatusCodePage/StatusCodeReExecuteFeature.cs @@ -3,12 +3,16 @@ namespace Microsoft.AspNetCore.Diagnostics { + /// Default implementation for . public class StatusCodeReExecuteFeature : IStatusCodeReExecuteFeature { + /// public string OriginalPath { get; set; } + /// public string OriginalPathBase { get; set; } + /// public string OriginalQueryString { get; set; } } -} \ No newline at end of file +}