Sharepoint EF6 Add-Migration Class not registered (Exception from HRESULT: 0x80040154 )

0

I'm creating Entity Framework Code First database access. I created the database manually (empty) and I want to create migration to generate tables. I had some problems like not seeing configuration class (which was created). I used solutions found in the web: reopen Visual Studio, add Microsoft.Build.xx.Core.dll to GAC.

Then I came across error:

Retrieving the COM class factory for component with CLSID {BDEADF26-C265-11D0-BCED-00A0C90AB50F} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).

So I changed platform to x64, then x86. The second one produced the same error, while error for the first one was:

Could not load file or assembly 'Dataaccess' or one of its dependencies. An attempt was made to load a program with an incorrect format.

At the beginning at least Enable-Migrations worked (there was some error, but configuration was created) and only Add-Migration returned those errors. Now none of the commands works.

How can I fix it?

EDIT: Enable-Migrations produces those errors but Configuration.cs file is created. The whole SharePoint project also compiles and runs (obviously I can't get anything from the database).

c#
entity-framework-6
sharepoint-2013
ef-migrations
asked on Stack Overflow May 29, 2019 by Pati K • edited May 29, 2019 by Pati K

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0