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.

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
CodePudding user response:
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
CodePudding user response:
Maybe you can install .net framework 4.0 through these methods.
- Modify the registry
Open the Registry Editor and navigate to: Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Client In the Version item, you can see the version of your system .Net component, It is recommended that you export the registry for backup first, and then change the value of the Version key to the version of the .Net component you need.
