Quantcast
Channel: ADO.NET, Entity Framework, LINQ to SQL, NHibernate
Viewing all articles
Browse latest Browse all 1698

Entity Framework Timeout Citing Pending Model Changes

$
0
0

First, I never did a code first migration before installing Identity and have not done one since because I do all my DB design work using SSMS. Lately I have been getting a timeout error after adding new columns to tables in my database and updating my EF model to consume those columns. There are also other times when my page loads but the new fields of data are empty. 

I can't think of any pending changes that need to be made to the DB since I already made them using SSMS. I just need to pull data from the new columns without anything timing out. I am also puzzled by the timeout since the database is on the same machine and has been running the entire time. I don't want to get into the habit of changing the design of my DB using code in Visual Studio. I never would have used it in the first place had it not been necessary to install Identity.

The error I get looks like this:

A database operation failed while processing the request.
SqlException: Execution Timeout Expired. The timeout period elapsed prior to completion of the operation or the server is not responding.
Win32Exception: The wait operation timed out.
There are pending model changes for ApplicationDbContext
In Visual Studio, use the Package Manager Console to scaffold a new migration for these changes and apply them to the database:

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:> dotnet ef migrations add [migration name]> dotnet ef database update


Viewing all articles
Browse latest Browse all 1698

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>