I am trying to replicate an example found on MSDN. I am using ASP.NET and EF 4.1 (CTP?). I\'ve used NuGet to install the EntityFramework package.
I am getting this e
I finally cracked it - after a slight wild goose chase thinking it was due to permissions.
Revelation: USE SQL PROFILER
(Note: I recently downgraded from EF6 to EF5)
Using SQL Profiler I quickly found the last SQL executed before the reported failure:
SELECT TOP (1)
[Project1].[C1] AS [C1],
[Project1].[MigrationId] AS [MigrationId],
[Project1].[Model] AS [Model]
FROM ( SELECT
[Extent1].[MigrationId] AS [MigrationId],
[Extent1].[Model] AS [Model],
1 AS [C1]
FROM [dbo].[__MigrationHistory] AS [Extent1]
) AS [Project1]
ORDER BY [Project1].[MigrationId] DESC
Well look at that - something to do with migrations. It's looking in __MigrationHistory
table - which I hadn't even realized it had created (I had already wiped out Migrations in my CSPROJ) and cleared that out.
So I pull up the rows for that table and see that it is tied to a specific product version (v6).
I actually downgraded from EF6 (which I didn't intend to install in the first place) to EF5 (which is more compatible with scaffolding) and that when the problems began.
My guess is that the Model (<Binary data>)
column is not backward compatible - hence the The provider did not return a ProviderManifest instance
error since it was unable to decode it.
I didn't have anything to lose and just wiped out this table completely and ran Update-Database -Verbose
and then was back up and running.
If you're in an advanced environment or already in production then wiping out this table may not be the solution, but this way allowed me to get right back to work.
This can happen sometimes when you place the connection string within the app.config of the wrong project in Visual Studio.
For example, I got this problem in EF 4.1 (the released version) project + WCF Data Service project and I noticed that I didn't have a connection string specified in the Data Services Project, where it was being used.
I just closed all instances of Visual Studio and reopened my solution.
I don't know what really happened, but I had the same solution opened from two different local workspaces (one with my local changes, one with the unchanged repository source code). I work with a postgres DB, Entity Framework 6, Visual Studio 2013 and ASP.NET MVC 5.