0

My system got corrupted two days ago and i have lost all my projects too. I had git backup of my project which is few months old, after downloading from git and it showed me the following issue. enter image description here

i am unbale to install .Net 4.0 as it says "a newer or Higher version of the framework already installed", so i tried downloading the closest version available ehich is .Net 4.5.1

But the project failed to build with following error, i tred .Net 4.5.1 & 4.8

"BC30928 Base class 'ObjectContext' specified for class 'My_ProjectEntities' cannot be different from the base class 'DbContext' of one of its other partial types."

I am using Visual Studio 2022 with Windows 11 Pro

Sulfy
  • 239
  • 4
  • 17
  • Is it possible NuGet pulled EF6 while you had previously used EF5? – djv Feb 02 '22 at 16:18
  • 1
    What harm would it be to simply update your project to use 4.8? – Hursey Feb 02 '22 at 20:44
  • @Hursey the project simply unable to build and throws "BC30928 Base class 'ObjectContext' specified for class 'My_ProjectEntities' cannot be different from the base class 'DbContext' of one of its other partial types." – Sulfy Feb 03 '22 at 12:02

1 Answers1

0

Removing Model1.edmx fixed my issue of

"BC30928 Base class 'ObjectContext' specified for class 'My_ProjectEntities' cannot be different from the base class 'DbContext' of one of its other partial types."

Then instead of trying to install dot net 4.0, updated to reccomended version of dot net 4.8.

later I had to update all my NuGet packages and then reinstall sqlTypes to fix some issue. hope this might help someone

Sulfy
  • 239
  • 4
  • 17