Add logger extensions with event ids (#405)

Addresses #393
This commit is contained in:
Jass Bagga 2017-09-15 14:26:47 -07:00 committed by GitHub
parent 479eb49ca9
commit d22bb2c908
12 changed files with 393 additions and 448 deletions

View File

@ -2,7 +2,6 @@
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Threading.Tasks;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Http.Features;
using Microsoft.Extensions.Logging;

View File

@ -8,6 +8,7 @@ using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.Internal;
using Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.Views;
using Microsoft.AspNetCore.Http;
using Microsoft.EntityFrameworkCore;
@ -115,7 +116,7 @@ namespace Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore
if (context == null)
{
_logger.LogError(Strings.FormatDatabaseErrorPageMiddleware_ContextNotRegistered(contextType.FullName));
_logger.ContextNotRegisteredDatabaseErrorPageMiddleware(contextType.FullName);
}
else
{
@ -123,7 +124,7 @@ namespace Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore
if (relationalDatabaseCreator == null)
{
_logger.LogDebug(Strings.DatabaseErrorPage_NotRelationalDatabase);
_logger.NotRelationalDatabase();
}
else
{
@ -164,10 +165,7 @@ namespace Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore
}
catch (Exception e)
{
_logger.LogError(
eventId: 0,
exception: e,
message: Strings.DatabaseErrorPageMiddleware_Exception);
_logger.DatabaseErrorPageMiddlewareException(e);
}
throw;
@ -176,13 +174,13 @@ namespace Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore
private bool ShouldDisplayErrorPage(Exception exception)
{
_logger.LogDebug(Strings.FormatDatabaseErrorPage_AttemptingToMatchException(exception.GetType()));
_logger.AttemptingToMatchException(exception.GetType());
var lastRecordedException = _localDiagnostic.Value.Exception;
if (lastRecordedException == null)
{
_logger.LogDebug(Strings.DatabaseErrorPage_NoRecordedException);
_logger.NoRecordedException();
return false;
}
@ -196,12 +194,12 @@ namespace Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore
if (!match)
{
_logger.LogDebug(Strings.DatabaseErrorPage_NoMatch);
_logger.NoMatch();
return false;
}
_logger.LogDebug(Strings.DatabaseErrorPage_Matched);
_logger.Matched();
return true;
}
@ -219,17 +217,17 @@ namespace Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore
switch (keyValuePair.Value)
{
case DbContextErrorEventData contextErrorEventData:
{
_localDiagnostic.Value.Hold(contextErrorEventData.Exception, contextErrorEventData.Context.GetType());
{
_localDiagnostic.Value.Hold(contextErrorEventData.Exception, contextErrorEventData.Context.GetType());
break;
}
break;
}
case DbContextTypeErrorEventData contextTypeErrorEventData:
{
_localDiagnostic.Value.Hold(contextTypeErrorEventData.Exception, contextTypeErrorEventData.ContextType);
{
_localDiagnostic.Value.Hold(contextTypeErrorEventData.Exception, contextTypeErrorEventData.ContextType);
break;
}
break;
}
}
}

View File

@ -0,0 +1,153 @@
// 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.Extensions.Logging;
namespace Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.Internal
{
internal static class DiagnosticsEntityFrameworkCoreLoggerExtensions
{
// MigrationsEndPointMiddleware
private static readonly Action<ILogger, Exception> _noContextType = LoggerMessage.Define(
LogLevel.Error,
new EventId(1, "NoContextType"),
"No context type was specified. Ensure the form data from the request includes a contextTypeName value, specifying the context to apply migrations for.");
private static readonly Action<ILogger, string, Exception> _invalidContextType = LoggerMessage.Define<string>(
LogLevel.Error,
new EventId(2, "InvalidContextType"),
"The context type '{ContextTypeName}' could not be loaded. Ensure this is the correct type name for the context you are trying to apply migrations for.");
private static readonly Action<ILogger, string, Exception> _contextNotRegistered = LoggerMessage.Define<string>(
LogLevel.Error,
new EventId(3, "ContextNotRegistered"),
"The context type '{ContextTypeName}' was not found in services. This usually means the context was not registered in services during startup. You probably want to call AddScoped<>() inside the UseServices(...) call in your application startup code.");
private static readonly Action<ILogger, string, Exception> _requestPathMatched = LoggerMessage.Define<string>(
LogLevel.Debug,
new EventId(4, "RequestPathMatched"),
"Request path matched the path configured for this migrations endpoint({RequestPath}). Attempting to process the migrations request.");
private static readonly Action<ILogger, string, Exception> _applyingMigrations = LoggerMessage.Define<string>(
LogLevel.Debug,
new EventId(5, "ApplyingMigrations"),
"Request is valid, applying migrations for context '{ContextTypeName}'");
private static readonly Action<ILogger, string, Exception> _migrationsApplied = LoggerMessage.Define<string>(
LogLevel.Debug,
new EventId(6, "MigrationsApplied"),
"Migrations successfully applied for context '{ContextTypeName}'.");
private static readonly Action<ILogger, string, Exception> _migrationsEndPointMiddlewareException = LoggerMessage.Define<string>(
LogLevel.Error,
new EventId(7, "MigrationsEndPointException"),
"An error occurred while applying the migrations for '{ContextTypeName}'. See InnerException for details:");
// DatabaseErrorPageMiddleware
private static readonly Action<ILogger, Type, Exception> _attemptingToMatchException = LoggerMessage.Define<Type>(
LogLevel.Debug,
new EventId(1, "AttemptingToMatchException"),
"{ExceptionType} occurred, checking if Entity Framework recorded this exception as resulting from a failed database operation.");
private static readonly Action<ILogger, Exception> _noRecordedException = LoggerMessage.Define(
LogLevel.Debug,
new EventId(2, "NoRecordedException"),
"Entity Framework did not record any exceptions due to failed database operations. This means the current exception is not a failed Entity Framework database operation, or the current exception occurred from a DbContext that was not obtained from request services.");
private static readonly Action<ILogger, Exception> _noMatch = LoggerMessage.Define(
LogLevel.Debug,
new EventId(3, "NoMatchFound"),
"The current exception (and its inner exceptions) do not match the last exception Entity Framework recorded due to a failed database operation. This means the database operation exception was handled and another exception occurred later in the request.");
private static readonly Action<ILogger, Exception> _matched = LoggerMessage.Define(
LogLevel.Debug,
new EventId(4, "MatchFound"),
"Entity Framework recorded that the current exception was due to a failed database operation. Attempting to show database error page.");
private static readonly Action<ILogger, string, Exception> _contextNotRegisteredDatabaseErrorPageMiddleware = LoggerMessage.Define<string>(
LogLevel.Error,
new EventId(5, "ContextNotRegistered"),
"The context type '{ContextTypeName}' was not found in services. This usually means the context was not registered in services during startup. You probably want to call AddScoped<>() inside the UseServices(...) call in your application startup code. Skipping display of the database error page.");
private static readonly Action<ILogger, Exception> _notRelationalDatabase = LoggerMessage.Define(
LogLevel.Debug,
new EventId(6, "NotRelationalDatabase"),
"The target data store is not a relational database. Skipping the database error page.");
private static readonly Action<ILogger, Exception> _databaseErrorPageMiddlewareException = LoggerMessage.Define(
LogLevel.Error,
new EventId(7, "DatabaseErrorPageException"),
"An exception occurred while calculating the database error page content. Skipping display of the database error page.");
public static void NoContextType(this ILogger logger)
{
_noContextType(logger, null);
}
public static void InvalidContextType(this ILogger logger, string contextTypeName)
{
_invalidContextType(logger, contextTypeName, null);
}
public static void ContextNotRegistered(this ILogger logger, string contextTypeName)
{
_contextNotRegistered(logger, contextTypeName, null);
}
public static void RequestPathMatched(this ILogger logger, string requestPath)
{
_requestPathMatched(logger, requestPath, null);
}
public static void ApplyingMigrations(this ILogger logger, string contextTypeName)
{
_applyingMigrations(logger, contextTypeName, null);
}
public static void MigrationsApplied(this ILogger logger, string contextTypeName)
{
_migrationsApplied(logger, contextTypeName, null);
}
public static void MigrationsEndPointMiddlewareException(this ILogger logger, string context, Exception exception)
{
_migrationsEndPointMiddlewareException(logger, context, exception);
}
public static void AttemptingToMatchException(this ILogger logger, Type exceptionType)
{
_attemptingToMatchException(logger, exceptionType, null);
}
public static void NoRecordedException(this ILogger logger)
{
_noRecordedException(logger, null);
}
public static void NoMatch(this ILogger logger)
{
_noMatch(logger, null);
}
public static void Matched(this ILogger logger)
{
_matched(logger, null);
}
public static void NotRelationalDatabase(this ILogger logger)
{
_notRelationalDatabase(logger, null);
}
public static void ContextNotRegisteredDatabaseErrorPageMiddleware(this ILogger logger, string contextTypeName)
{
_contextNotRegisteredDatabaseErrorPageMiddleware(logger, contextTypeName, null);
}
public static void DatabaseErrorPageMiddlewareException(this ILogger logger, Exception exception)
{
_databaseErrorPageMiddlewareException(logger, exception);
}
}
}

View File

@ -5,6 +5,7 @@ using System;
using System.Net;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.Internal;
using Microsoft.AspNetCore.Http;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Logging;
@ -66,7 +67,7 @@ namespace Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore
if (context.Request.Path.Equals(_options.Path))
{
_logger.LogDebug(Strings.FormatMigrationsEndPointMiddleware_RequestPathMatched(context.Request.Path));
_logger.RequestPathMatched(context.Request.Path);
var db = await GetDbContext(context, _logger);
@ -74,7 +75,7 @@ namespace Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore
{
try
{
_logger.LogDebug(Strings.FormatMigrationsEndPointMiddleware_ApplyingMigrations(db.GetType().FullName));
_logger.ApplyingMigrations(db.GetType().FullName);
db.Database.Migrate();
@ -82,13 +83,13 @@ namespace Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore
context.Response.Headers.Add("Pragma", new[] { "no-cache" });
context.Response.Headers.Add("Cache-Control", new[] { "no-cache" });
_logger.LogDebug(Strings.FormatMigrationsEndPointMiddleware_Applied(db.GetType().FullName));
_logger.MigrationsApplied(db.GetType().FullName);
}
catch (Exception ex)
{
var message = Strings.FormatMigrationsEndPointMiddleware_Exception(db.GetType().FullName) + ex;
_logger.LogError(message);
_logger.MigrationsEndPointMiddlewareException(db.GetType().FullName, ex);
throw new InvalidOperationException(message, ex);
}
@ -107,7 +108,7 @@ namespace Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore
if (string.IsNullOrWhiteSpace(contextTypeName))
{
logger.LogError(Strings.MigrationsEndPointMiddleware_NoContextType);
logger.NoContextType();
await WriteErrorToResponse(context.Response, Strings.MigrationsEndPointMiddleware_NoContextType);
@ -120,7 +121,7 @@ namespace Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore
{
var message = Strings.FormatMigrationsEndPointMiddleware_InvalidContextType(contextTypeName);
logger.LogError(message);
logger.InvalidContextType(contextTypeName);
await WriteErrorToResponse(context.Response, message);
@ -133,7 +134,7 @@ namespace Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore
{
var message = Strings.FormatMigrationsEndPointMiddleware_ContextNotRegistered(contextType.FullName);
logger.LogError(message);
logger.ContextNotRegistered(contextType.FullName);
await WriteErrorToResponse(context.Response, message);

View File

@ -11,548 +11,382 @@ namespace Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore
= new ResourceManager("Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.Strings", typeof(Strings).GetTypeInfo().Assembly);
/// <summary>
/// The context type '{0}' was not found in services. This usually means the context was not registered in services during startup. You probably want to call AddScoped&lt;{0}&gt;() inside the UseServices(...) call in your application startup code. Skipping display of the database error page.
/// The context type '{0}' was not found in services. This usually means the context was not registered in services during startup. You probably want to call AddScoped&lt;&gt;() inside the UseServices(...) call in your application startup code. Skipping display of the database error page.
/// </summary>
internal static string DatabaseErrorPageMiddleware_ContextNotRegistered
{
get { return GetString("DatabaseErrorPageMiddleware_ContextNotRegistered"); }
get => GetString("DatabaseErrorPageMiddleware_ContextNotRegistered");
}
/// <summary>
/// The context type '{0}' was not found in services. This usually means the context was not registered in services during startup. You probably want to call AddScoped&lt;{0}&gt;() inside the UseServices(...) call in your application startup code. Skipping display of the database error page.
/// The context type '{0}' was not found in services. This usually means the context was not registered in services during startup. You probably want to call AddScoped&lt;&gt;() inside the UseServices(...) call in your application startup code. Skipping display of the database error page.
/// </summary>
internal static string FormatDatabaseErrorPageMiddleware_ContextNotRegistered(object p0)
{
return string.Format(CultureInfo.CurrentCulture, GetString("DatabaseErrorPageMiddleware_ContextNotRegistered"), p0);
}
=> string.Format(CultureInfo.CurrentCulture, GetString("DatabaseErrorPageMiddleware_ContextNotRegistered"), p0);
/// <summary>
/// An exception occurred while calculating the database error page content. Skipping display of the database error page.
/// </summary>
internal static string DatabaseErrorPageMiddleware_Exception
{
get { return GetString("DatabaseErrorPageMiddleware_Exception"); }
get => GetString("DatabaseErrorPageMiddleware_Exception");
}
/// <summary>
/// An exception occurred while calculating the database error page content. Skipping display of the database error page.
/// </summary>
internal static string FormatDatabaseErrorPageMiddleware_Exception()
{
return GetString("DatabaseErrorPageMiddleware_Exception");
}
=> GetString("DatabaseErrorPageMiddleware_Exception");
/// <summary>
/// &gt; dotnet ef migrations add [migration name]
/// </summary>
internal static string DatabaseErrorPage_AddMigrationCommandCLI
{
get { return GetString("DatabaseErrorPage_AddMigrationCommandCLI"); }
get => GetString("DatabaseErrorPage_AddMigrationCommandCLI");
}
/// <summary>
/// &gt; dotnet ef migrations add [migration name]
/// </summary>
internal static string FormatDatabaseErrorPage_AddMigrationCommandCLI()
{
return GetString("DatabaseErrorPage_AddMigrationCommandCLI");
}
=> GetString("DatabaseErrorPage_AddMigrationCommandCLI");
/// <summary>
/// Apply Migrations
/// </summary>
internal static string DatabaseErrorPage_ApplyMigrationsButton
{
get { return GetString("DatabaseErrorPage_ApplyMigrationsButton"); }
get => GetString("DatabaseErrorPage_ApplyMigrationsButton");
}
/// <summary>
/// Apply Migrations
/// </summary>
internal static string FormatDatabaseErrorPage_ApplyMigrationsButton()
{
return GetString("DatabaseErrorPage_ApplyMigrationsButton");
}
=> GetString("DatabaseErrorPage_ApplyMigrationsButton");
/// <summary>
/// Migrations Applied
/// </summary>
internal static string DatabaseErrorPage_ApplyMigrationsButtonDone
{
get { return GetString("DatabaseErrorPage_ApplyMigrationsButtonDone"); }
get => GetString("DatabaseErrorPage_ApplyMigrationsButtonDone");
}
/// <summary>
/// Migrations Applied
/// </summary>
internal static string FormatDatabaseErrorPage_ApplyMigrationsButtonDone()
{
return GetString("DatabaseErrorPage_ApplyMigrationsButtonDone");
}
=> GetString("DatabaseErrorPage_ApplyMigrationsButtonDone");
/// <summary>
/// Applying Migrations...
/// </summary>
internal static string DatabaseErrorPage_ApplyMigrationsButtonRunning
{
get { return GetString("DatabaseErrorPage_ApplyMigrationsButtonRunning"); }
get => GetString("DatabaseErrorPage_ApplyMigrationsButtonRunning");
}
/// <summary>
/// Applying Migrations...
/// </summary>
internal static string FormatDatabaseErrorPage_ApplyMigrationsButtonRunning()
{
return GetString("DatabaseErrorPage_ApplyMigrationsButtonRunning");
}
=> GetString("DatabaseErrorPage_ApplyMigrationsButtonRunning");
/// <summary>
/// An error occurred applying migrations, try applying them from the command line
/// </summary>
internal static string DatabaseErrorPage_ApplyMigrationsFailed
{
get { return GetString("DatabaseErrorPage_ApplyMigrationsFailed"); }
get => GetString("DatabaseErrorPage_ApplyMigrationsFailed");
}
/// <summary>
/// An error occurred applying migrations, try applying them from the command line
/// </summary>
internal static string FormatDatabaseErrorPage_ApplyMigrationsFailed()
{
return GetString("DatabaseErrorPage_ApplyMigrationsFailed");
}
=> GetString("DatabaseErrorPage_ApplyMigrationsFailed");
/// <summary>
/// In Visual Studio, you can use Package Manager Console apply pending migrations to the database:
/// In Visual Studio, you can use the Package Manager Console to apply pending migrations to the database:
/// </summary>
internal static string DatabaseErrorPage_HowToApplyFromPMC
{
get { return GetString("DatabaseErrorPage_HowToApplyFromPMC"); }
get => GetString("DatabaseErrorPage_HowToApplyFromPMC");
}
/// <summary>
/// In Visual Studio, you can use Package Manager Console apply pending migrations to the database:
/// In Visual Studio, you can use the Package Manager Console to apply pending migrations to the database:
/// </summary>
internal static string FormatDatabaseErrorPage_HowToApplyFromPMC()
{
return GetString("DatabaseErrorPage_HowToApplyFromPMC");
}
=> GetString("DatabaseErrorPage_HowToApplyFromPMC");
/// <summary>
/// Try refreshing the page
/// </summary>
internal static string DatabaseErrorPage_MigrationsAppliedRefresh
{
get { return GetString("DatabaseErrorPage_MigrationsAppliedRefresh"); }
get => GetString("DatabaseErrorPage_MigrationsAppliedRefresh");
}
/// <summary>
/// Try refreshing the page
/// </summary>
internal static string FormatDatabaseErrorPage_MigrationsAppliedRefresh()
{
return GetString("DatabaseErrorPage_MigrationsAppliedRefresh");
}
=> GetString("DatabaseErrorPage_MigrationsAppliedRefresh");
/// <summary>
/// In Visual Studio, use Package Manager Console to scaffold a new migration and apply it to the database:
/// In Visual Studio, use the Package Manager Console to scaffold a new migration and apply it to the database:
/// </summary>
internal static string DatabaseErrorPage_NoDbOrMigrationsInfoPMC
{
get { return GetString("DatabaseErrorPage_NoDbOrMigrationsInfoPMC"); }
get => GetString("DatabaseErrorPage_NoDbOrMigrationsInfoPMC");
}
/// <summary>
/// In Visual Studio, use Package Manager Console to scaffold a new migration and apply it to the database:
/// In Visual Studio, use the Package Manager Console to scaffold a new migration and apply it to the database:
/// </summary>
internal static string FormatDatabaseErrorPage_NoDbOrMigrationsInfoPMC()
{
return GetString("DatabaseErrorPage_NoDbOrMigrationsInfoPMC");
}
=> GetString("DatabaseErrorPage_NoDbOrMigrationsInfoPMC");
/// <summary>
/// Use migrations to create the database for {0}
/// </summary>
internal static string DatabaseErrorPage_NoDbOrMigrationsTitle
{
get { return GetString("DatabaseErrorPage_NoDbOrMigrationsTitle"); }
get => GetString("DatabaseErrorPage_NoDbOrMigrationsTitle");
}
/// <summary>
/// Use migrations to create the database for {0}
/// </summary>
internal static string FormatDatabaseErrorPage_NoDbOrMigrationsTitle(object p0)
{
return string.Format(CultureInfo.CurrentCulture, GetString("DatabaseErrorPage_NoDbOrMigrationsTitle"), p0);
}
=> string.Format(CultureInfo.CurrentCulture, GetString("DatabaseErrorPage_NoDbOrMigrationsTitle"), p0);
/// <summary>
/// In Visual Studio, use Package Manager Console to scaffold a new migration for these changes and apply them to the database:
/// In Visual Studio, use the Package Manager Console to scaffold a new migration for these changes and apply them to the database:
/// </summary>
internal static string DatabaseErrorPage_PendingChangesInfoPMC
{
get { return GetString("DatabaseErrorPage_PendingChangesInfoPMC"); }
get => GetString("DatabaseErrorPage_PendingChangesInfoPMC");
}
/// <summary>
/// In Visual Studio, use Package Manager Console to scaffold a new migration for these changes and apply them to the database:
/// In Visual Studio, use the Package Manager Console to scaffold a new migration for these changes and apply them to the database:
/// </summary>
internal static string FormatDatabaseErrorPage_PendingChangesInfoPMC()
{
return GetString("DatabaseErrorPage_PendingChangesInfoPMC");
}
=> GetString("DatabaseErrorPage_PendingChangesInfoPMC");
/// <summary>
/// There are pending model changes for {0}
/// </summary>
internal static string DatabaseErrorPage_PendingChangesTitle
{
get { return GetString("DatabaseErrorPage_PendingChangesTitle"); }
get => GetString("DatabaseErrorPage_PendingChangesTitle");
}
/// <summary>
/// There are pending model changes for {0}
/// </summary>
internal static string FormatDatabaseErrorPage_PendingChangesTitle(object p0)
{
return string.Format(CultureInfo.CurrentCulture, GetString("DatabaseErrorPage_PendingChangesTitle"), p0);
}
=> string.Format(CultureInfo.CurrentCulture, GetString("DatabaseErrorPage_PendingChangesTitle"), p0);
/// <summary>
/// There are migrations for {0} that have not been applied to the database
/// </summary>
internal static string DatabaseErrorPage_PendingMigrationsInfo
{
get { return GetString("DatabaseErrorPage_PendingMigrationsInfo"); }
get => GetString("DatabaseErrorPage_PendingMigrationsInfo");
}
/// <summary>
/// There are migrations for {0} that have not been applied to the database
/// </summary>
internal static string FormatDatabaseErrorPage_PendingMigrationsInfo(object p0)
{
return string.Format(CultureInfo.CurrentCulture, GetString("DatabaseErrorPage_PendingMigrationsInfo"), p0);
}
=> string.Format(CultureInfo.CurrentCulture, GetString("DatabaseErrorPage_PendingMigrationsInfo"), p0);
/// <summary>
/// Applying existing migrations for {0} may resolve this issue
/// </summary>
internal static string DatabaseErrorPage_PendingMigrationsTitle
{
get { return GetString("DatabaseErrorPage_PendingMigrationsTitle"); }
get => GetString("DatabaseErrorPage_PendingMigrationsTitle");
}
/// <summary>
/// Applying existing migrations for {0} may resolve this issue
/// </summary>
internal static string FormatDatabaseErrorPage_PendingMigrationsTitle(object p0)
{
return string.Format(CultureInfo.CurrentCulture, GetString("DatabaseErrorPage_PendingMigrationsTitle"), p0);
}
=> string.Format(CultureInfo.CurrentCulture, GetString("DatabaseErrorPage_PendingMigrationsTitle"), p0);
/// <summary>
/// &gt; dotnet ef database update
/// </summary>
internal static string DatabaseErrorPage_ApplyMigrationsCommandCLI
{
get { return GetString("DatabaseErrorPage_ApplyMigrationsCommandCLI"); }
get => GetString("DatabaseErrorPage_ApplyMigrationsCommandCLI");
}
/// <summary>
/// &gt; dotnet ef database update
/// </summary>
internal static string FormatDatabaseErrorPage_ApplyMigrationsCommandCLI()
{
return GetString("DatabaseErrorPage_ApplyMigrationsCommandCLI");
}
/// <summary>
/// Migrations successfully applied for context '{0}'.
/// </summary>
internal static string MigrationsEndPointMiddleware_Applied
{
get { return GetString("MigrationsEndPointMiddleware_Applied"); }
}
/// <summary>
/// Migrations successfully applied for context '{0}'.
/// </summary>
internal static string FormatMigrationsEndPointMiddleware_Applied(object p0)
{
return string.Format(CultureInfo.CurrentCulture, GetString("MigrationsEndPointMiddleware_Applied"), p0);
}
/// <summary>
/// Request is valid, applying migrations for context '{0}'.
/// </summary>
internal static string MigrationsEndPointMiddleware_ApplyingMigrations
{
get { return GetString("MigrationsEndPointMiddleware_ApplyingMigrations"); }
}
/// <summary>
/// Request is valid, applying migrations for context '{0}'.
/// </summary>
internal static string FormatMigrationsEndPointMiddleware_ApplyingMigrations(object p0)
{
return string.Format(CultureInfo.CurrentCulture, GetString("MigrationsEndPointMiddleware_ApplyingMigrations"), p0);
}
=> GetString("DatabaseErrorPage_ApplyMigrationsCommandCLI");
/// <summary>
/// The context type '{0}' was not found in services. This usually means the context was not registered in services during startup. You probably want to call AddScoped&lt;{0}&gt;() inside the UseServices(...) call in your application startup code.
/// </summary>
internal static string MigrationsEndPointMiddleware_ContextNotRegistered
{
get { return GetString("MigrationsEndPointMiddleware_ContextNotRegistered"); }
get => GetString("MigrationsEndPointMiddleware_ContextNotRegistered");
}
/// <summary>
/// The context type '{0}' was not found in services. This usually means the context was not registered in services during startup. You probably want to call AddScoped&lt;{0}&gt;() inside the UseServices(...) call in your application startup code.
/// </summary>
internal static string FormatMigrationsEndPointMiddleware_ContextNotRegistered(object p0)
{
return string.Format(CultureInfo.CurrentCulture, GetString("MigrationsEndPointMiddleware_ContextNotRegistered"), p0);
}
=> string.Format(CultureInfo.CurrentCulture, GetString("MigrationsEndPointMiddleware_ContextNotRegistered"), p0);
/// <summary>
/// An error occurred while applying the migrations for '{0}'. See InnerException for details.
/// </summary>
internal static string MigrationsEndPointMiddleware_Exception
{
get { return GetString("MigrationsEndPointMiddleware_Exception"); }
get => GetString("MigrationsEndPointMiddleware_Exception");
}
/// <summary>
/// An error occurred while applying the migrations for '{0}'. See InnerException for details.
/// </summary>
internal static string FormatMigrationsEndPointMiddleware_Exception(object p0)
{
return string.Format(CultureInfo.CurrentCulture, GetString("MigrationsEndPointMiddleware_Exception"), p0);
}
=> string.Format(CultureInfo.CurrentCulture, GetString("MigrationsEndPointMiddleware_Exception"), p0);
/// <summary>
/// The context type '{0}' could not be loaded. Ensure this is the correct type name for the context you are trying to apply migrations for.
/// </summary>
internal static string MigrationsEndPointMiddleware_InvalidContextType
{
get { return GetString("MigrationsEndPointMiddleware_InvalidContextType"); }
get => GetString("MigrationsEndPointMiddleware_InvalidContextType");
}
/// <summary>
/// The context type '{0}' could not be loaded. Ensure this is the correct type name for the context you are trying to apply migrations for.
/// </summary>
internal static string FormatMigrationsEndPointMiddleware_InvalidContextType(object p0)
{
return string.Format(CultureInfo.CurrentCulture, GetString("MigrationsEndPointMiddleware_InvalidContextType"), p0);
}
=> string.Format(CultureInfo.CurrentCulture, GetString("MigrationsEndPointMiddleware_InvalidContextType"), p0);
/// <summary>
/// No context type was specified. Ensure the form data from the request includes a contextTypeName value, specifying the context to apply migrations for.
/// </summary>
internal static string MigrationsEndPointMiddleware_NoContextType
{
get { return GetString("MigrationsEndPointMiddleware_NoContextType"); }
get => GetString("MigrationsEndPointMiddleware_NoContextType");
}
/// <summary>
/// No context type was specified. Ensure the form data from the request includes a contextTypeName value, specifying the context to apply migrations for.
/// </summary>
internal static string FormatMigrationsEndPointMiddleware_NoContextType()
{
return GetString("MigrationsEndPointMiddleware_NoContextType");
}
/// <summary>
/// Request path matched the path configured for this migrations endpoint ({0}). Attempting to process the migrations request.
/// </summary>
internal static string MigrationsEndPointMiddleware_RequestPathMatched
{
get { return GetString("MigrationsEndPointMiddleware_RequestPathMatched"); }
}
/// <summary>
/// Request path matched the path configured for this migrations endpoint ({0}). Attempting to process the migrations request.
/// </summary>
internal static string FormatMigrationsEndPointMiddleware_RequestPathMatched(object p0)
{
return string.Format(CultureInfo.CurrentCulture, GetString("MigrationsEndPointMiddleware_RequestPathMatched"), p0);
}
=> GetString("MigrationsEndPointMiddleware_NoContextType");
/// <summary>
/// A database operation failed while processing the request.
/// </summary>
internal static string DatabaseErrorPage_Title
{
get { return GetString("DatabaseErrorPage_Title"); }
get => GetString("DatabaseErrorPage_Title");
}
/// <summary>
/// A database operation failed while processing the request.
/// </summary>
internal static string FormatDatabaseErrorPage_Title()
{
return GetString("DatabaseErrorPage_Title");
}
/// <summary>
/// {0} occurred, checking if Entity Framework recorded this exception as resulting from a failed database operation.
/// </summary>
internal static string DatabaseErrorPage_AttemptingToMatchException
{
get { return GetString("DatabaseErrorPage_AttemptingToMatchException"); }
}
/// <summary>
/// {0} occurred, checking if Entity Framework recorded this exception as resulting from a failed database operation.
/// </summary>
internal static string FormatDatabaseErrorPage_AttemptingToMatchException(object p0)
{
return string.Format(CultureInfo.CurrentCulture, GetString("DatabaseErrorPage_AttemptingToMatchException"), p0);
}
/// <summary>
/// Entity Framework recorded that the current exception was due to a failed database operation. Attempting to show database error page.
/// </summary>
internal static string DatabaseErrorPage_Matched
{
get { return GetString("DatabaseErrorPage_Matched"); }
}
/// <summary>
/// Entity Framework recorded that the current exception was due to a failed database operation. Attempting to show database error page.
/// </summary>
internal static string FormatDatabaseErrorPage_Matched()
{
return GetString("DatabaseErrorPage_Matched");
}
=> GetString("DatabaseErrorPage_Title");
/// <summary>
/// Entity Framework did not record any exceptions due to failed database operations. This means the current exception is not a failed Entity Framework database operation, or the current exception occurred from a DbContext that was not obtained from request services.
/// </summary>
internal static string DatabaseErrorPage_NoRecordedException
{
get { return GetString("DatabaseErrorPage_NoRecordedException"); }
get => GetString("DatabaseErrorPage_NoRecordedException");
}
/// <summary>
/// Entity Framework did not record any exceptions due to failed database operations. This means the current exception is not a failed Entity Framework database operation, or the current exception occurred from a DbContext that was not obtained from request services.
/// </summary>
internal static string FormatDatabaseErrorPage_NoRecordedException()
{
return GetString("DatabaseErrorPage_NoRecordedException");
}
/// <summary>
/// The target data store is not a relational database. Skipping the database error page.
/// </summary>
internal static string DatabaseErrorPage_NotRelationalDatabase
{
get { return GetString("DatabaseErrorPage_NotRelationalDatabase"); }
}
/// <summary>
/// The target data store is not a relational database. Skipping the database error page.
/// </summary>
internal static string FormatDatabaseErrorPage_NotRelationalDatabase()
{
return GetString("DatabaseErrorPage_NotRelationalDatabase");
}
/// <summary>
/// The current exception (and its inner exceptions) do not match the last exception Entity Framework recorded due to a failed database operation. This means the database operation exception was handled and another exception occurred later in the request.
/// </summary>
internal static string DatabaseErrorPage_NoMatch
{
get { return GetString("DatabaseErrorPage_NoMatch"); }
}
/// <summary>
/// The current exception (and its inner exceptions) do not match the last exception Entity Framework recorded due to a failed database operation. This means the database operation exception was handled and another exception occurred later in the request.
/// </summary>
internal static string FormatDatabaseErrorPage_NoMatch()
{
return GetString("DatabaseErrorPage_NoMatch");
}
=> GetString("DatabaseErrorPage_NoRecordedException");
/// <summary>
/// PM&gt; Add-Migration [migration name]
/// </summary>
internal static string DatabaseErrorPage_AddMigrationCommandPMC
{
get { return GetString("DatabaseErrorPage_AddMigrationCommandPMC"); }
get => GetString("DatabaseErrorPage_AddMigrationCommandPMC");
}
/// <summary>
/// PM&gt; Add-Migration [migration name]
/// </summary>
internal static string FormatDatabaseErrorPage_AddMigrationCommandPMC()
{
return GetString("DatabaseErrorPage_AddMigrationCommandPMC");
}
=> GetString("DatabaseErrorPage_AddMigrationCommandPMC");
/// <summary>
/// PM&gt; Update-Database
/// </summary>
internal static string DatabaseErrorPage_ApplyMigrationsCommandPMC
{
get { return GetString("DatabaseErrorPage_ApplyMigrationsCommandPMC"); }
get => GetString("DatabaseErrorPage_ApplyMigrationsCommandPMC");
}
/// <summary>
/// PM&gt; Update-Database
/// </summary>
internal static string FormatDatabaseErrorPage_ApplyMigrationsCommandPMC()
{
return GetString("DatabaseErrorPage_ApplyMigrationsCommandPMC");
}
=> GetString("DatabaseErrorPage_ApplyMigrationsCommandPMC");
/// <summary>
/// Alternatively, you can scaffold a new migration and apply it from a command prompt at your project directory:
/// </summary>
internal static string DatabaseErrorPage_NoDbOrMigrationsInfoCLI
{
get { return GetString("DatabaseErrorPage_NoDbOrMigrationsInfoCLI"); }
get => GetString("DatabaseErrorPage_NoDbOrMigrationsInfoCLI");
}
/// <summary>
/// Alternatively, you can scaffold a new migration and apply it from a command prompt at your project directory:
/// </summary>
internal static string FormatDatabaseErrorPage_NoDbOrMigrationsInfoCLI()
{
return GetString("DatabaseErrorPage_NoDbOrMigrationsInfoCLI");
}
=> GetString("DatabaseErrorPage_NoDbOrMigrationsInfoCLI");
/// <summary>
/// Alternatively, you can scaffold a new migration and apply it from a command prompt at your project directory:
/// </summary>
internal static string DatabaseErrorPage_PendingChangesInfoCLI
{
get { return GetString("DatabaseErrorPage_PendingChangesInfoCLI"); }
get => GetString("DatabaseErrorPage_PendingChangesInfoCLI");
}
/// <summary>
/// Alternatively, you can scaffold a new migration and apply it from a command prompt at your project directory:
/// </summary>
internal static string FormatDatabaseErrorPage_PendingChangesInfoCLI()
{
return GetString("DatabaseErrorPage_PendingChangesInfoCLI");
}
=> GetString("DatabaseErrorPage_PendingChangesInfoCLI");
/// <summary>
/// Alternatively, you can apply pending migrations from a command prompt at your project directory:
/// </summary>
internal static string DatabaseErrorPage_HowToApplyFromCLI
{
get { return GetString("DatabaseErrorPage_HowToApplyFromCLI"); }
get => GetString("DatabaseErrorPage_HowToApplyFromCLI");
}
/// <summary>
/// Alternatively, you can apply pending migrations from a command prompt at your project directory:
/// </summary>
internal static string FormatDatabaseErrorPage_HowToApplyFromCLI()
{
return GetString("DatabaseErrorPage_HowToApplyFromCLI");
}
=> GetString("DatabaseErrorPage_HowToApplyFromCLI");
private static string GetString(string name, params string[] formatterNames)
{

View File

@ -118,7 +118,7 @@
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="DatabaseErrorPageMiddleware_ContextNotRegistered" xml:space="preserve">
<value>The context type '{0}' was not found in services. This usually means the context was not registered in services during startup. You probably want to call AddScoped&lt;{0}&gt;() inside the UseServices(...) call in your application startup code. Skipping display of the database error page.</value>
<value>The context type '{0}' was not found in services. This usually means the context was not registered in services during startup. You probably want to call AddScoped&lt;&gt;() inside the UseServices(...) call in your application startup code. Skipping display of the database error page.</value>
</data>
<data name="DatabaseErrorPageMiddleware_Exception" xml:space="preserve">
<value>An exception occurred while calculating the database error page content. Skipping display of the database error page.</value>
@ -165,12 +165,6 @@
<data name="DatabaseErrorPage_ApplyMigrationsCommandCLI" xml:space="preserve">
<value>&gt; dotnet ef database update</value>
</data>
<data name="MigrationsEndPointMiddleware_Applied" xml:space="preserve">
<value>Migrations successfully applied for context '{0}'.</value>
</data>
<data name="MigrationsEndPointMiddleware_ApplyingMigrations" xml:space="preserve">
<value>Request is valid, applying migrations for context '{0}'.</value>
</data>
<data name="MigrationsEndPointMiddleware_ContextNotRegistered" xml:space="preserve">
<value>The context type '{0}' was not found in services. This usually means the context was not registered in services during startup. You probably want to call AddScoped&lt;{0}&gt;() inside the UseServices(...) call in your application startup code.</value>
</data>
@ -183,27 +177,12 @@
<data name="MigrationsEndPointMiddleware_NoContextType" xml:space="preserve">
<value>No context type was specified. Ensure the form data from the request includes a contextTypeName value, specifying the context to apply migrations for.</value>
</data>
<data name="MigrationsEndPointMiddleware_RequestPathMatched" xml:space="preserve">
<value>Request path matched the path configured for this migrations endpoint ({0}). Attempting to process the migrations request.</value>
</data>
<data name="DatabaseErrorPage_Title" xml:space="preserve">
<value>A database operation failed while processing the request.</value>
</data>
<data name="DatabaseErrorPage_AttemptingToMatchException" xml:space="preserve">
<value>{0} occurred, checking if Entity Framework recorded this exception as resulting from a failed database operation.</value>
</data>
<data name="DatabaseErrorPage_Matched" xml:space="preserve">
<value>Entity Framework recorded that the current exception was due to a failed database operation. Attempting to show database error page.</value>
</data>
<data name="DatabaseErrorPage_NoRecordedException" xml:space="preserve">
<value>Entity Framework did not record any exceptions due to failed database operations. This means the current exception is not a failed Entity Framework database operation, or the current exception occurred from a DbContext that was not obtained from request services.</value>
</data>
<data name="DatabaseErrorPage_NotRelationalDatabase" xml:space="preserve">
<value>The target data store is not a relational database. Skipping the database error page.</value>
</data>
<data name="DatabaseErrorPage_NoMatch" xml:space="preserve">
<value>The current exception (and its inner exceptions) do not match the last exception Entity Framework recorded due to a failed database operation. This means the database operation exception was handled and another exception occurred later in the request.</value>
</data>
<data name="DatabaseErrorPage_AddMigrationCommandPMC" xml:space="preserve">
<value>PM&gt; Add-Migration [migration name]</value>
</data>

View File

@ -4,9 +4,9 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Diagnostics.Internal;
using Microsoft.AspNetCore.Diagnostics.RazorViews;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Http;
@ -42,7 +42,7 @@ namespace Microsoft.AspNetCore.Diagnostics
IOptions<DeveloperExceptionPageOptions> options,
ILoggerFactory loggerFactory,
IHostingEnvironment hostingEnvironment,
System.Diagnostics.DiagnosticSource diagnosticSource)
DiagnosticSource diagnosticSource)
{
if (next == null)
{
@ -75,11 +75,11 @@ namespace Microsoft.AspNetCore.Diagnostics
}
catch (Exception ex)
{
_logger.LogError(0, ex, "An unhandled exception has occurred while executing the request");
_logger.UnhandledException(ex);
if (context.Response.HasStarted)
{
_logger.LogWarning("The response has already started, the error page middleware will not be executed.");
_logger.ResponseStartedErrorPageMiddleware();
throw;
}
@ -100,7 +100,7 @@ namespace Microsoft.AspNetCore.Diagnostics
catch (Exception ex2)
{
// If there's a Exception while generating the error page, re-throw the original exception.
_logger.LogError(0, ex2, "An exception was thrown attempting to display the error page.");
_logger.DisplayErrorPageException(ex2);
}
throw;
}

View File

@ -5,6 +5,7 @@ using System;
using System.Diagnostics;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Diagnostics.Internal;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
@ -45,11 +46,11 @@ namespace Microsoft.AspNetCore.Diagnostics
}
catch (Exception ex)
{
_logger.LogError(0, ex, "An unhandled exception has occurred: " + ex.Message);
_logger.UnhandledException(ex);
// We can't do anything if the response has already started, just abort.
if (context.Response.HasStarted)
{
_logger.LogWarning("The response has already started, the error handler will not be executed.");
_logger.ResponseStartedErrorHandler();
throw;
}
@ -84,7 +85,7 @@ namespace Microsoft.AspNetCore.Diagnostics
catch (Exception ex2)
{
// Suppress secondary exceptions, re-throw the original.
_logger.LogError(0, ex2, "An exception was thrown attempting to execute the error handler.");
_logger.ErrorHandlerException(ex2);
}
finally
{

View File

@ -0,0 +1,54 @@
// 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.Extensions.Logging;
namespace Microsoft.AspNetCore.Diagnostics.Internal
{
internal static class DiagnosticsLoggerExtensions
{
// ExceptionHandlerMiddleware & DeveloperExceptionPageMiddleware
private static readonly Action<ILogger, Exception> _unhandledException =
LoggerMessage.Define(LogLevel.Error, new EventId(1, "UnhandledException"), "An unhandled exception has occurred while executing the request.");
// ExceptionHandlerMiddleware
private static readonly Action<ILogger, Exception> _responseStartedErrorHandler =
LoggerMessage.Define(LogLevel.Warning, new EventId(2, "ResponseStarted"), "The response has already started, the error handler will not be executed.");
private static readonly Action<ILogger, Exception> _errorHandlerException =
LoggerMessage.Define(LogLevel.Error, new EventId(3, "Exception"), "An exception was thrown attempting to execute the error handler.");
// DeveloperExceptionPageMiddleware
private static readonly Action<ILogger, Exception> _responseStartedErrorPageMiddleware =
LoggerMessage.Define(LogLevel.Warning, new EventId(2, "ResponseStarted"), "The response has already started, the error page middleware will not be executed.");
private static readonly Action<ILogger, Exception> _displayErrorPageException =
LoggerMessage.Define(LogLevel.Error, new EventId(3, "DisplayErrorPageException"), "An exception was thrown attempting to display the error page.");
public static void UnhandledException(this ILogger logger, Exception exception)
{
_unhandledException(logger, exception);
}
public static void ResponseStartedErrorHandler(this ILogger logger)
{
_responseStartedErrorHandler(logger, null);
}
public static void ErrorHandlerException(this ILogger logger, Exception exception)
{
_errorHandlerException(logger, exception);
}
public static void ResponseStartedErrorPageMiddleware(this ILogger logger)
{
_responseStartedErrorPageMiddleware(logger, null);
}
public static void DisplayErrorPageException(this ILogger logger, Exception exception)
{
_displayErrorPageException(logger, exception);
}
}
}

View File

@ -15,656 +15,574 @@ namespace Microsoft.AspNetCore.Diagnostics
/// </summary>
internal static string DiagnosticsPageHtml_Information
{
get { return GetString("DiagnosticsPageHtml_Information"); }
get => GetString("DiagnosticsPageHtml_Information");
}
/// <summary>
/// You are seeing this page because DiagnosticsPageMiddleware was added to your web application.
/// </summary>
internal static string FormatDiagnosticsPageHtml_Information()
{
return GetString("DiagnosticsPageHtml_Information");
}
=> GetString("DiagnosticsPageHtml_Information");
/// <summary>
/// Test Error Message
/// </summary>
internal static string DiagnosticsPageHtml_TestErrorMessage
{
get { return GetString("DiagnosticsPageHtml_TestErrorMessage"); }
get => GetString("DiagnosticsPageHtml_TestErrorMessage");
}
/// <summary>
/// Test Error Message
/// </summary>
internal static string FormatDiagnosticsPageHtml_TestErrorMessage()
{
return GetString("DiagnosticsPageHtml_TestErrorMessage");
}
=> GetString("DiagnosticsPageHtml_TestErrorMessage");
/// <summary>
/// Test Error Page
/// </summary>
internal static string DiagnosticsPageHtml_TestErrorSection
{
get { return GetString("DiagnosticsPageHtml_TestErrorSection"); }
get => GetString("DiagnosticsPageHtml_TestErrorSection");
}
/// <summary>
/// Test Error Page
/// </summary>
internal static string FormatDiagnosticsPageHtml_TestErrorSection()
{
return GetString("DiagnosticsPageHtml_TestErrorSection");
}
=> GetString("DiagnosticsPageHtml_TestErrorSection");
/// <summary>
/// Diagnostics Page
/// </summary>
internal static string DiagnosticsPageHtml_Title
{
get { return GetString("DiagnosticsPageHtml_Title"); }
get => GetString("DiagnosticsPageHtml_Title");
}
/// <summary>
/// Diagnostics Page
/// </summary>
internal static string FormatDiagnosticsPageHtml_Title()
{
return GetString("DiagnosticsPageHtml_Title");
}
=> GetString("DiagnosticsPageHtml_Title");
/// <summary>
/// Cookies
/// </summary>
internal static string ErrorPageHtml_CookiesButton
{
get { return GetString("ErrorPageHtml_CookiesButton"); }
get => GetString("ErrorPageHtml_CookiesButton");
}
/// <summary>
/// Cookies
/// </summary>
internal static string FormatErrorPageHtml_CookiesButton()
{
return GetString("ErrorPageHtml_CookiesButton");
}
=> GetString("ErrorPageHtml_CookiesButton");
/// <summary>
/// Headers
/// </summary>
internal static string ErrorPageHtml_HeadersButton
{
get { return GetString("ErrorPageHtml_HeadersButton"); }
get => GetString("ErrorPageHtml_HeadersButton");
}
/// <summary>
/// Headers
/// </summary>
internal static string FormatErrorPageHtml_HeadersButton()
{
return GetString("ErrorPageHtml_HeadersButton");
}
=> GetString("ErrorPageHtml_HeadersButton");
/// <summary>
/// No cookie data.
/// </summary>
internal static string ErrorPageHtml_NoCookieData
{
get { return GetString("ErrorPageHtml_NoCookieData"); }
get => GetString("ErrorPageHtml_NoCookieData");
}
/// <summary>
/// No cookie data.
/// </summary>
internal static string FormatErrorPageHtml_NoCookieData()
{
return GetString("ErrorPageHtml_NoCookieData");
}
=> GetString("ErrorPageHtml_NoCookieData");
/// <summary>
/// No header data.
/// </summary>
internal static string ErrorPageHtml_NoHeaderData
{
get { return GetString("ErrorPageHtml_NoHeaderData"); }
get => GetString("ErrorPageHtml_NoHeaderData");
}
/// <summary>
/// No header data.
/// </summary>
internal static string FormatErrorPageHtml_NoHeaderData()
{
return GetString("ErrorPageHtml_NoHeaderData");
}
=> GetString("ErrorPageHtml_NoHeaderData");
/// <summary>
/// No QueryString data.
/// </summary>
internal static string ErrorPageHtml_NoQueryStringData
{
get { return GetString("ErrorPageHtml_NoQueryStringData"); }
get => GetString("ErrorPageHtml_NoQueryStringData");
}
/// <summary>
/// No QueryString data.
/// </summary>
internal static string FormatErrorPageHtml_NoQueryStringData()
{
return GetString("ErrorPageHtml_NoQueryStringData");
}
=> GetString("ErrorPageHtml_NoQueryStringData");
/// <summary>
/// Query
/// </summary>
internal static string ErrorPageHtml_QueryButton
{
get { return GetString("ErrorPageHtml_QueryButton"); }
get => GetString("ErrorPageHtml_QueryButton");
}
/// <summary>
/// Query
/// </summary>
internal static string FormatErrorPageHtml_QueryButton()
{
return GetString("ErrorPageHtml_QueryButton");
}
=> GetString("ErrorPageHtml_QueryButton");
/// <summary>
/// Stack
/// </summary>
internal static string ErrorPageHtml_StackButton
{
get { return GetString("ErrorPageHtml_StackButton"); }
get => GetString("ErrorPageHtml_StackButton");
}
/// <summary>
/// Stack
/// </summary>
internal static string FormatErrorPageHtml_StackButton()
{
return GetString("ErrorPageHtml_StackButton");
}
=> GetString("ErrorPageHtml_StackButton");
/// <summary>
/// Internal Server Error
/// </summary>
internal static string ErrorPageHtml_Title
{
get { return GetString("ErrorPageHtml_Title"); }
get => GetString("ErrorPageHtml_Title");
}
/// <summary>
/// Internal Server Error
/// </summary>
internal static string FormatErrorPageHtml_Title()
{
return GetString("ErrorPageHtml_Title");
}
=> GetString("ErrorPageHtml_Title");
/// <summary>
/// An unhandled exception occurred while processing the request.
/// </summary>
internal static string ErrorPageHtml_UnhandledException
{
get { return GetString("ErrorPageHtml_UnhandledException"); }
get => GetString("ErrorPageHtml_UnhandledException");
}
/// <summary>
/// An unhandled exception occurred while processing the request.
/// </summary>
internal static string FormatErrorPageHtml_UnhandledException()
{
return GetString("ErrorPageHtml_UnhandledException");
}
=> GetString("ErrorPageHtml_UnhandledException");
/// <summary>
/// Unknown location
/// </summary>
internal static string ErrorPageHtml_UnknownLocation
{
get { return GetString("ErrorPageHtml_UnknownLocation"); }
get => GetString("ErrorPageHtml_UnknownLocation");
}
/// <summary>
/// Unknown location
/// </summary>
internal static string FormatErrorPageHtml_UnknownLocation()
{
return GetString("ErrorPageHtml_UnknownLocation");
}
=> GetString("ErrorPageHtml_UnknownLocation");
/// <summary>
/// Value
/// </summary>
internal static string ErrorPageHtml_ValueColumn
{
get { return GetString("ErrorPageHtml_ValueColumn"); }
get => GetString("ErrorPageHtml_ValueColumn");
}
/// <summary>
/// Value
/// </summary>
internal static string FormatErrorPageHtml_ValueColumn()
{
return GetString("ErrorPageHtml_ValueColumn");
}
=> GetString("ErrorPageHtml_ValueColumn");
/// <summary>
/// Variable
/// </summary>
internal static string ErrorPageHtml_VariableColumn
{
get { return GetString("ErrorPageHtml_VariableColumn"); }
get => GetString("ErrorPageHtml_VariableColumn");
}
/// <summary>
/// Variable
/// </summary>
internal static string FormatErrorPageHtml_VariableColumn()
{
return GetString("ErrorPageHtml_VariableColumn");
}
=> GetString("ErrorPageHtml_VariableColumn");
/// <summary>
/// The path must start with a '/'.
/// </summary>
internal static string Exception_PathMustStartWithSlash
{
get { return GetString("Exception_PathMustStartWithSlash"); }
get => GetString("Exception_PathMustStartWithSlash");
}
/// <summary>
/// The path must start with a '/'.
/// </summary>
internal static string FormatException_PathMustStartWithSlash()
{
return GetString("Exception_PathMustStartWithSlash");
}
=> GetString("Exception_PathMustStartWithSlash");
/// <summary>
/// Name
/// </summary>
internal static string RuntimeInfoPage_PackageNameColumnName
{
get { return GetString("RuntimeInfoPage_PackageNameColumnName"); }
get => GetString("RuntimeInfoPage_PackageNameColumnName");
}
/// <summary>
/// Name
/// </summary>
internal static string FormatRuntimeInfoPage_PackageNameColumnName()
{
return GetString("RuntimeInfoPage_PackageNameColumnName");
}
=> GetString("RuntimeInfoPage_PackageNameColumnName");
/// <summary>
/// Path
/// </summary>
internal static string RuntimeInfoPage_PackagePathColumnName
{
get { return GetString("RuntimeInfoPage_PackagePathColumnName"); }
get => GetString("RuntimeInfoPage_PackagePathColumnName");
}
/// <summary>
/// Path
/// </summary>
internal static string FormatRuntimeInfoPage_PackagePathColumnName()
{
return GetString("RuntimeInfoPage_PackagePathColumnName");
}
=> GetString("RuntimeInfoPage_PackagePathColumnName");
/// <summary>
/// Packages:
/// </summary>
internal static string RuntimeInfoPage_Packages
{
get { return GetString("RuntimeInfoPage_Packages"); }
get => GetString("RuntimeInfoPage_Packages");
}
/// <summary>
/// Packages:
/// </summary>
internal static string FormatRuntimeInfoPage_Packages()
{
return GetString("RuntimeInfoPage_Packages");
}
=> GetString("RuntimeInfoPage_Packages");
/// <summary>
/// Could not retrieve the list of loaded packages.
/// </summary>
internal static string RuntimeInfoPage_PackagesFail
{
get { return GetString("RuntimeInfoPage_PackagesFail"); }
get => GetString("RuntimeInfoPage_PackagesFail");
}
/// <summary>
/// Could not retrieve the list of loaded packages.
/// </summary>
internal static string FormatRuntimeInfoPage_PackagesFail()
{
return GetString("RuntimeInfoPage_PackagesFail");
}
=> GetString("RuntimeInfoPage_PackagesFail");
/// <summary>
/// Version
/// </summary>
internal static string RuntimeInfoPage_PackageVersionColumnName
{
get { return GetString("RuntimeInfoPage_PackageVersionColumnName"); }
get => GetString("RuntimeInfoPage_PackageVersionColumnName");
}
/// <summary>
/// Version
/// </summary>
internal static string FormatRuntimeInfoPage_PackageVersionColumnName()
{
return GetString("RuntimeInfoPage_PackageVersionColumnName");
}
=> GetString("RuntimeInfoPage_PackageVersionColumnName");
/// <summary>
/// Runtime Version:
/// </summary>
internal static string RuntimeInfoPage_RuntimeVersion
{
get { return GetString("RuntimeInfoPage_RuntimeVersion"); }
get => GetString("RuntimeInfoPage_RuntimeVersion");
}
/// <summary>
/// Runtime Version:
/// </summary>
internal static string FormatRuntimeInfoPage_RuntimeVersion()
{
return GetString("RuntimeInfoPage_RuntimeVersion");
}
=> GetString("RuntimeInfoPage_RuntimeVersion");
/// <summary>
/// Could not determine the runtime version.
/// </summary>
internal static string RuntimeInfoPage_RuntimeVersionFail
{
get { return GetString("RuntimeInfoPage_RuntimeVersionFail"); }
get => GetString("RuntimeInfoPage_RuntimeVersionFail");
}
/// <summary>
/// Could not determine the runtime version.
/// </summary>
internal static string FormatRuntimeInfoPage_RuntimeVersionFail()
{
return GetString("RuntimeInfoPage_RuntimeVersionFail");
}
=> GetString("RuntimeInfoPage_RuntimeVersionFail");
/// <summary>
/// Runtime Information
/// </summary>
internal static string RuntimeInfoPage_Title
{
get { return GetString("RuntimeInfoPage_Title"); }
get => GetString("RuntimeInfoPage_Title");
}
/// <summary>
/// Runtime Information
/// </summary>
internal static string FormatRuntimeInfoPage_Title()
{
return GetString("RuntimeInfoPage_Title");
}
=> GetString("RuntimeInfoPage_Title");
/// <summary>
/// Welcome
/// </summary>
internal static string WelcomeHeader
{
get { return GetString("WelcomeHeader"); }
get => GetString("WelcomeHeader");
}
/// <summary>
/// Welcome
/// </summary>
internal static string FormatWelcomeHeader()
{
return GetString("WelcomeHeader");
}
=> GetString("WelcomeHeader");
/// <summary>
/// Learn more about the Microsoft ASP.NET Core components
/// </summary>
internal static string WelcomeLearnMicrosoftAspNet
{
get { return GetString("WelcomeLearnMicrosoftAspNet"); }
get => GetString("WelcomeLearnMicrosoftAspNet");
}
/// <summary>
/// Learn more about the Microsoft ASP.NET Core components
/// </summary>
internal static string FormatWelcomeLearnMicrosoftAspNet()
{
return GetString("WelcomeLearnMicrosoftAspNet");
}
=> GetString("WelcomeLearnMicrosoftAspNet");
/// <summary>
/// Browser
/// </summary>
internal static string WelcomePageImageText_Browser
{
get { return GetString("WelcomePageImageText_Browser"); }
get => GetString("WelcomePageImageText_Browser");
}
/// <summary>
/// Browser
/// </summary>
internal static string FormatWelcomePageImageText_Browser()
{
return GetString("WelcomePageImageText_Browser");
}
=> GetString("WelcomePageImageText_Browser");
/// <summary>
/// Learn More
/// </summary>
internal static string WelcomePageImageText_LearnMore
{
get { return GetString("WelcomePageImageText_LearnMore"); }
get => GetString("WelcomePageImageText_LearnMore");
}
/// <summary>
/// Learn More
/// </summary>
internal static string FormatWelcomePageImageText_LearnMore()
{
return GetString("WelcomePageImageText_LearnMore");
}
=> GetString("WelcomePageImageText_LearnMore");
/// <summary>
/// Light Bulb
/// </summary>
internal static string WelcomePageImageText_LightBulb
{
get { return GetString("WelcomePageImageText_LightBulb"); }
get => GetString("WelcomePageImageText_LightBulb");
}
/// <summary>
/// Light Bulb
/// </summary>
internal static string FormatWelcomePageImageText_LightBulb()
{
return GetString("WelcomePageImageText_LightBulb");
}
=> GetString("WelcomePageImageText_LightBulb");
/// <summary>
/// Skyline
/// </summary>
internal static string WelcomePageImageText_Skyline
{
get { return GetString("WelcomePageImageText_Skyline"); }
get => GetString("WelcomePageImageText_Skyline");
}
/// <summary>
/// Skyline
/// </summary>
internal static string FormatWelcomePageImageText_Skyline()
{
return GetString("WelcomePageImageText_Skyline");
}
=> GetString("WelcomePageImageText_Skyline");
/// <summary>
/// Your ASP.NET Core application has been successfully started
/// </summary>
internal static string WelcomeStarted
{
get { return GetString("WelcomeStarted"); }
get => GetString("WelcomeStarted");
}
/// <summary>
/// Your ASP.NET Core application has been successfully started
/// </summary>
internal static string FormatWelcomeStarted()
{
return GetString("WelcomeStarted");
}
=> GetString("WelcomeStarted");
/// <summary>
/// Your ASP.NET Core application has been successfully started.
/// </summary>
internal static string WelcomeTitle
{
get { return GetString("WelcomeTitle"); }
get => GetString("WelcomeTitle");
}
/// <summary>
/// Your ASP.NET Core application has been successfully started.
/// </summary>
internal static string FormatWelcomeTitle()
{
return GetString("WelcomeTitle");
}
=> GetString("WelcomeTitle");
/// <summary>
/// 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.
/// </summary>
internal static string ErrorPageHtml_CompilationException
{
get { return GetString("ErrorPageHtml_CompilationException"); }
get => GetString("ErrorPageHtml_CompilationException");
}
/// <summary>
/// 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.
/// </summary>
internal static string FormatErrorPageHtml_CompilationException()
{
return GetString("ErrorPageHtml_CompilationException");
}
=> GetString("ErrorPageHtml_CompilationException");
/// <summary>
/// Operating System:
/// </summary>
internal static string RuntimeInfoPage_OperatingSystem
{
get { return GetString("RuntimeInfoPage_OperatingSystem"); }
get => GetString("RuntimeInfoPage_OperatingSystem");
}
/// <summary>
/// Operating System:
/// </summary>
internal static string FormatRuntimeInfoPage_OperatingSystem()
{
return GetString("RuntimeInfoPage_OperatingSystem");
}
=> GetString("RuntimeInfoPage_OperatingSystem");
/// <summary>
/// Runtime Architecture:
/// </summary>
internal static string RuntimeInfoPage_RuntimeArchitecture
{
get { return GetString("RuntimeInfoPage_RuntimeArchitecture"); }
get => GetString("RuntimeInfoPage_RuntimeArchitecture");
}
/// <summary>
/// Runtime Architecture:
/// </summary>
internal static string FormatRuntimeInfoPage_RuntimeArchitecture()
{
return GetString("RuntimeInfoPage_RuntimeArchitecture");
}
=> GetString("RuntimeInfoPage_RuntimeArchitecture");
/// <summary>
/// Runtime Type:
/// </summary>
internal static string RuntimeInfoPage_RuntimeType
{
get { return GetString("RuntimeInfoPage_RuntimeType"); }
get => GetString("RuntimeInfoPage_RuntimeType");
}
/// <summary>
/// Runtime Type:
/// </summary>
internal static string FormatRuntimeInfoPage_RuntimeType()
{
return GetString("RuntimeInfoPage_RuntimeType");
}
=> GetString("RuntimeInfoPage_RuntimeType");
/// <summary>
/// Could not determine the operating system.
/// </summary>
internal static string RuntimeInfoPage_OperatingSystemFail
{
get { return GetString("RuntimeInfoPage_OperatingSystemFail"); }
get => GetString("RuntimeInfoPage_OperatingSystemFail");
}
/// <summary>
/// Could not determine the operating system.
/// </summary>
internal static string FormatRuntimeInfoPage_OperatingSystemFail()
{
return GetString("RuntimeInfoPage_OperatingSystemFail");
}
=> GetString("RuntimeInfoPage_OperatingSystemFail");
/// <summary>
/// Could not determine the runtime architecture.
/// </summary>
internal static string RuntimeInfoPage_RuntimeArchitectureFail
{
get { return GetString("RuntimeInfoPage_RuntimeArchitectureFail"); }
get => GetString("RuntimeInfoPage_RuntimeArchitectureFail");
}
/// <summary>
/// Could not determine the runtime architecture.
/// </summary>
internal static string FormatRuntimeInfoPage_RuntimeArchitectureFail()
{
return GetString("RuntimeInfoPage_RuntimeArchitectureFail");
}
=> GetString("RuntimeInfoPage_RuntimeArchitectureFail");
/// <summary>
/// Could not determine the runtime type.
/// </summary>
internal static string RuntimeInfoPage_RuntimeTypeFail
{
get { return GetString("RuntimeInfoPage_RuntimeTypeFail"); }
get => GetString("RuntimeInfoPage_RuntimeTypeFail");
}
/// <summary>
/// Could not determine the runtime type.
/// </summary>
internal static string FormatRuntimeInfoPage_RuntimeTypeFail()
{
return GetString("RuntimeInfoPage_RuntimeTypeFail");
}
=> GetString("RuntimeInfoPage_RuntimeTypeFail");
/// <summary>
/// Environment:
/// </summary>
internal static string RuntimeInfoPage_Environment
{
get { return GetString("RuntimeInfoPage_Environment"); }
get => GetString("RuntimeInfoPage_Environment");
}
/// <summary>
/// Environment:
/// </summary>
internal static string FormatRuntimeInfoPage_Environment()
{
return GetString("RuntimeInfoPage_Environment");
}
=> GetString("RuntimeInfoPage_Environment");
private static string GetString(string name, params string[] formatterNames)
{

View File

@ -18,4 +18,8 @@
<PackageReference Include="xunit.runner.visualstudio" />
</ItemGroup>
<ItemGroup>
<Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" />
</ItemGroup>
</Project>

View File

@ -28,4 +28,8 @@
<PackageReference Include="xunit.runner.visualstudio" />
</ItemGroup>
<ItemGroup>
<Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" />
</ItemGroup>
</Project>