diff --git a/src/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore/Properties/Strings.Designer.cs b/src/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore/Properties/Strings.Designer.cs
index 5c4ad39df4..77fefd57c5 100644
--- a/src/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore/Properties/Strings.Designer.cs
+++ b/src/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore/Properties/Strings.Designer.cs
@@ -77,17 +77,17 @@ namespace Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore
///
/// > dotnet ef migrations add [migration name]
///
- internal static string DatabaseErrorPage_AddMigrationCommand
+ internal static string DatabaseErrorPage_AddMigrationCommandCLI
{
- get { return GetString("DatabaseErrorPage_AddMigrationCommand"); }
+ get { return GetString("DatabaseErrorPage_AddMigrationCommandCLI"); }
}
///
/// > dotnet ef migrations add [migration name]
///
- internal static string FormatDatabaseErrorPage_AddMigrationCommand()
+ internal static string FormatDatabaseErrorPage_AddMigrationCommandCLI()
{
- return GetString("DatabaseErrorPage_AddMigrationCommand");
+ return GetString("DatabaseErrorPage_AddMigrationCommandCLI");
}
///
@@ -155,19 +155,19 @@ namespace Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore
}
///
- /// You can also apply migrations from the command line:
+ /// In Visual Studio, you can use Package Manager Console apply pending migrations to the database:
///
- internal static string DatabaseErrorPage_HowToApplyFromCmd
+ internal static string DatabaseErrorPage_HowToApplyFromPMC
{
- get { return GetString("DatabaseErrorPage_HowToApplyFromCmd"); }
+ get { return GetString("DatabaseErrorPage_HowToApplyFromPMC"); }
}
///
- /// You can also apply migrations from the command line:
+ /// In Visual Studio, you can use Package Manager Console apply pending migrations to the database:
///
- internal static string FormatDatabaseErrorPage_HowToApplyFromCmd()
+ internal static string FormatDatabaseErrorPage_HowToApplyFromPMC()
{
- return GetString("DatabaseErrorPage_HowToApplyFromCmd");
+ return GetString("DatabaseErrorPage_HowToApplyFromPMC");
}
///
@@ -187,19 +187,19 @@ namespace Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore
}
///
- /// From the command line, scaffold a new migration and apply it to the database:
+ /// In Visual Studio, use Package Manager Console to scaffold a new migration and apply it to the database:
///
- internal static string DatabaseErrorPage_NoDbOrMigrationsInfo
+ internal static string DatabaseErrorPage_NoDbOrMigrationsInfoPMC
{
- get { return GetString("DatabaseErrorPage_NoDbOrMigrationsInfo"); }
+ get { return GetString("DatabaseErrorPage_NoDbOrMigrationsInfoPMC"); }
}
///
- /// From the command line, scaffold a new migration and apply it to the database:
+ /// In Visual Studio, use Package Manager Console to scaffold a new migration and apply it to the database:
///
- internal static string FormatDatabaseErrorPage_NoDbOrMigrationsInfo()
+ internal static string FormatDatabaseErrorPage_NoDbOrMigrationsInfoPMC()
{
- return GetString("DatabaseErrorPage_NoDbOrMigrationsInfo");
+ return GetString("DatabaseErrorPage_NoDbOrMigrationsInfoPMC");
}
///
@@ -219,19 +219,19 @@ namespace Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore
}
///
- /// Scaffold a new migration for these changes and apply them to the database from the command line:
+ /// In Visual Studio, use Package Manager Console to scaffold a new migration for these changes and apply them to the database:
///
- internal static string DatabaseErrorPage_PendingChangesInfo
+ internal static string DatabaseErrorPage_PendingChangesInfoPMC
{
- get { return GetString("DatabaseErrorPage_PendingChangesInfo"); }
+ get { return GetString("DatabaseErrorPage_PendingChangesInfoPMC"); }
}
///
- /// Scaffold a new migration for these changes and apply them to the database from the command line:
+ /// In Visual Studio, use Package Manager Console to scaffold a new migration for these changes and apply them to the database:
///
- internal static string FormatDatabaseErrorPage_PendingChangesInfo()
+ internal static string FormatDatabaseErrorPage_PendingChangesInfoPMC()
{
- return GetString("DatabaseErrorPage_PendingChangesInfo");
+ return GetString("DatabaseErrorPage_PendingChangesInfoPMC");
}
///
@@ -285,17 +285,17 @@ namespace Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore
///
/// > dotnet ef database update
///
- internal static string DatabaseErrorPage_ApplyMigrationsCommand
+ internal static string DatabaseErrorPage_ApplyMigrationsCommandCLI
{
- get { return GetString("DatabaseErrorPage_ApplyMigrationsCommand"); }
+ get { return GetString("DatabaseErrorPage_ApplyMigrationsCommandCLI"); }
}
///
/// > dotnet ef database update
///
- internal static string FormatDatabaseErrorPage_ApplyMigrationsCommand()
+ internal static string FormatDatabaseErrorPage_ApplyMigrationsCommandCLI()
{
- return GetString("DatabaseErrorPage_ApplyMigrationsCommand");
+ return GetString("DatabaseErrorPage_ApplyMigrationsCommandCLI");
}
///
@@ -522,6 +522,86 @@ namespace Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore
return GetString("DatabaseErrorPage_NoMatch");
}
+ ///
+ /// PM> Add-Migration [migration name]
+ ///
+ internal static string DatabaseErrorPage_AddMigrationCommandPMC
+ {
+ get { return GetString("DatabaseErrorPage_AddMigrationCommandPMC"); }
+ }
+
+ ///
+ /// PM> Add-Migration [migration name]
+ ///
+ internal static string FormatDatabaseErrorPage_AddMigrationCommandPMC()
+ {
+ return GetString("DatabaseErrorPage_AddMigrationCommandPMC");
+ }
+
+ ///
+ /// PM> Update-Database
+ ///
+ internal static string DatabaseErrorPage_ApplyMigrationsCommandPMC
+ {
+ get { return GetString("DatabaseErrorPage_ApplyMigrationsCommandPMC"); }
+ }
+
+ ///
+ /// PM> Update-Database
+ ///
+ internal static string FormatDatabaseErrorPage_ApplyMigrationsCommandPMC()
+ {
+ return GetString("DatabaseErrorPage_ApplyMigrationsCommandPMC");
+ }
+
+ ///
+ /// Alternatively, you can scaffold a new migration and apply it from a command prompt at your project directory:
+ ///
+ internal static string DatabaseErrorPage_NoDbOrMigrationsInfoCLI
+ {
+ get { return GetString("DatabaseErrorPage_NoDbOrMigrationsInfoCLI"); }
+ }
+
+ ///
+ /// Alternatively, you can scaffold a new migration and apply it from a command prompt at your project directory:
+ ///
+ internal static string FormatDatabaseErrorPage_NoDbOrMigrationsInfoCLI()
+ {
+ return GetString("DatabaseErrorPage_NoDbOrMigrationsInfoCLI");
+ }
+
+ ///
+ /// Alternatively, you can scaffold a new migration and apply it from a command prompt at your project directory:
+ ///
+ internal static string DatabaseErrorPage_PendingChangesInfoCLI
+ {
+ get { return GetString("DatabaseErrorPage_PendingChangesInfoCLI"); }
+ }
+
+ ///
+ /// Alternatively, you can scaffold a new migration and apply it from a command prompt at your project directory:
+ ///
+ internal static string FormatDatabaseErrorPage_PendingChangesInfoCLI()
+ {
+ return GetString("DatabaseErrorPage_PendingChangesInfoCLI");
+ }
+
+ ///
+ /// Alternatively, you can apply pending migrations from a command prompt at your project directory:
+ ///
+ internal static string DatabaseErrorPage_HowToApplyFromCLI
+ {
+ get { return GetString("DatabaseErrorPage_HowToApplyFromCLI"); }
+ }
+
+ ///
+ /// Alternatively, you can apply pending migrations from a command prompt at your project directory:
+ ///
+ internal static string FormatDatabaseErrorPage_HowToApplyFromCLI()
+ {
+ return GetString("DatabaseErrorPage_HowToApplyFromCLI");
+ }
+
private static string GetString(string name, params string[] formatterNames)
{
var value = _resourceManager.GetString(name);
diff --git a/src/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore/Strings.resx b/src/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore/Strings.resx
index 1a7d2359a5..92de6f0740 100644
--- a/src/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore/Strings.resx
+++ b/src/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore/Strings.resx
@@ -129,7 +129,7 @@
An exception occurred while calculating the database error page content. Skipping display of the database error page.
-
+
> dotnet ef migrations add [migration name]
@@ -144,20 +144,20 @@
An error occurred applying migrations, try applying them from the command line
-
- You can also apply migrations from the command line:
+
+ In Visual Studio, you can use the Package Manager Console to apply pending migrations to the database:Try refreshing the page
-
- From the command line, 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:Use migrations to create the database for {0}
-
- Scaffold a new migration for these changes and apply them to the database from the command line:
+
+ In Visual Studio, use the Package Manager Console to scaffold a new migration for these changes and apply them to the database:There are pending model changes for {0}
@@ -168,7 +168,7 @@
Applying existing migrations for {0} may resolve this issue
-
+
> dotnet ef database update
@@ -213,4 +213,19 @@
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.
+
+ PM> Add-Migration [migration name]
+
+
+ PM> Update-Database
+
+
+ Alternatively, you can scaffold a new migration and apply it from a command prompt at your project directory:
+
+
+ Alternatively, you can scaffold a new migration and apply it from a command prompt at your project directory:
+
+
+ Alternatively, you can apply pending migrations from a command prompt at your project directory:
+
\ No newline at end of file
diff --git a/src/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore/Views/DatabaseErrorPage.cs b/src/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore/Views/DatabaseErrorPage.cs
index 468415eb03..95820eb3dd 100644
--- a/src/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore/Views/DatabaseErrorPage.cs
+++ b/src/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore/Views/DatabaseErrorPage.cs
@@ -122,24 +122,42 @@ using Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.Views
#line hidden
WriteLiteral("\r\n
", content);
- Assert.DoesNotContain(StringsHelpers.GetResourceString("FormatDatabaseErrorPage_AddMigrationCommand").Replace(">", ">"), content);
+ Assert.DoesNotContain(StringsHelpers.GetResourceString("FormatDatabaseErrorPage_AddMigrationCommandPMC").Replace(">", ">"), content);
}
class PendingMigrationsMiddleware
@@ -457,4 +457,4 @@ namespace Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.Tests
return _javaScriptEncoder.Encode(content);
}
}
-}
\ No newline at end of file
+}
diff --git a/test/Microsoft.AspNetCore.Diagnostics.FunctionalTests/DatabaseErrorPageSampleTest.cs b/test/Microsoft.AspNetCore.Diagnostics.FunctionalTests/DatabaseErrorPageSampleTest.cs
index 822fe8970b..acb68868b1 100644
--- a/test/Microsoft.AspNetCore.Diagnostics.FunctionalTests/DatabaseErrorPageSampleTest.cs
+++ b/test/Microsoft.AspNetCore.Diagnostics.FunctionalTests/DatabaseErrorPageSampleTest.cs
@@ -32,7 +32,7 @@ namespace Microsoft.AspNetCore.Diagnostics.FunctionalTests
// Assert
var body = await response.Content.ReadAsStringAsync();
Assert.Equal(HttpStatusCode.InternalServerError, response.StatusCode);
- Assert.Contains("From the command line, scaffold a new migration and apply it to the database:", body);
+ Assert.Contains("In Visual Studio, use the Package Manager Console to scaffold a new migration and apply it to the database:", body);
}
}
}