Free Code Snippets in C#, Net Framework, Office 365, ASP.Net,WPF, Visual Studio, SQL Server, Antivirus free
#

 

 

The first time an Asp.Net MVC Core 2 application with Authentication is called, the error occurs:

A database operation failed while processing the request.

 

URL: https://localhost:44328/Account/Register

 

 

Solution:

Open Packet Manager Console and type Update Database

 

Complete error message

A database operation failed while processing the request.


SqlException: Cannot open database "aspnet-Auth01b-D7FBAB0F-A682-4F66-924E-A3CE4E1F6A0B" requested by the login. The login failed. Login failed for user 'DESKTOP-F634M99\Raimund'. 

Applying existing migrations for ApplicationDbContext may resolve this issue


There are migrations for ApplicationDbContext that have not been applied to the database
  • 00000000000000_CreateIdentitySchema


In Visual Studio, you can use the Package Manager Console to apply pending migrations to the database:

PM> Update-Database
Alternatively, you can apply pending migrations from a command prompt at your project directory:

> dotnet ef database update

 

 

Subject: Asp.Net MVC Core 2 EF

 

Mobile
»
ASP.Net: A database operation failed while processing the request.
»
API error: Could not get any response
»
ASP Error: System.InvalidOperationException, An exception occurred while reading a database value
»
ASP EF Error: Unable to create object of type DbContext
»
Asp.net Error: No DbContext was found in assembly
»
Asp.net Errors: The entity type xxx requires a primary key to be defined.

.

Contact for Jobs, Project Requests: raimund.popp@microsoft-programmierer.de