I have an application that has been running successfully for several years. Recently, I upgraded the .NET framework to version 8.0, after which I started encountering the following error:
Method not found: 'Void Microsoft.EntityFrameworkCore.Storage.RelationalTypeMapping..ctor(System.String, System.Type, System.Nullable1<System.Data.DbType>, Boolean, System.Nullable1<Int32>, Boolean, System.Nullable1<Int32>, System.Nullable1<Int32>)'.
The application consists of three projects: the main application, a Models project, and a Data project.
While researching this issue, I found that it is often caused by a version mismatch in .NET or Entity Framework Core. I reviewed the .csproj files for all three projects and ensured they are targeting the same .NET version. However, the error still persists.
My main application currently has the following dependencies:

My Data project has the following dependencies:

and the Model has following dependencies:

I tried to match all the versions, but still I am getting the same error. After matching all the versions, I deleted , the obj and bin folder from each project and clean the project and rebuilt the entire solution. I am still getting the same error. This is the csproj <itemgroup> of the main project:
<ItemGroup>
<PackageReference Include="BitMiracle.Docotic.Pdf" Version="8.6.13474" />
<PackageReference Include="Microsoft.AspNetCore" Version="2.3.9" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.Negotiate" Version="8.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="8.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="7.0.1" />
<PackageReference Include="Microsoft.CodeAnalysis.Workspaces.Common" Version="5.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="8.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.Extensions.Configuration" Version="8.0.0" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="8.0.0" />
<PackageReference Include="System.DirectoryServices.AccountManagement" Version="8.0.1" />
<PackageReference Include="System.DirectoryServices.Protocols" Version="8.0.0" />
<PackageReference Include="System.IO.FileSystem" Version="4.3.0" />
</ItemGroup>
This is csproj file of the data project:
<ItemGroup>
<PackageReference Include="BitMiracle.Docotic.Pdf" Version="8.6.13474" />
<PackageReference Include="Microsoft.AspNetCore" Version="2.3.9" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="8.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="7.0.1" />
<PackageReference Include="Microsoft.Extensions.Configuration" Version="8.0.0" />
<PackageReference Include="Newtonsoft.Json" Version="8.0.1" />
<PackageReference Include="System.DirectoryServices.AccountManagement" Version="8.0.1" />
<PackageReference Include="System.DirectoryServices.Protocols" Version="8.0.0" />
<PackageReference Include="System.Drawing.Common" Version="8.0.1" />
<PackageReference Include="System.IO.FileSystem" Version="4.3.0" />
</ItemGroup>
This is the csproj of Models:
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore" Version="2.3.9" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="7.0.1" />
</ItemGroup>
Not sure, what I need to do to get rid of this error. Any help will be greatly appreciated.