Skip to content

Upgrade Microsoft.EntityFrameworkCore 8.0.3 Error #33431

@sugogine

Description

@sugogine

Recently I have migrated my project from .NET 6 to .NET 8.

I have used .NET Upgrade Assistant to upgrade my project, I am able to build solution with .NET 8 packages. I can see only following packages are upgraded in my solution.

Old Packages

<PackageReference Include="ErikEJ.EntityFrameworkCore.SqlServer.DateOnlyTimeOnly" Version="7.0.8" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="7.0.8" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="7.0.8" />

My Upgraded packages


<PackageReference Include="ErikEJ.EntityFrameworkCore.SqlServer.DateOnlyTimeOnly" Version="7.0.8" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.3" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.3" />

I ran solution solution to test my code, but when code related to EntityFrameworkCore executes it throws following error.

We are adding db context as follows previously, I can see UseDateOnlyTimeOnly() is part of following package, but there is no upgrade in this package so is it causing any issue @ErikEJ.

<PackageReference Include="ErikEJ.EntityFrameworkCore.SqlServer.DateOnlyTimeOnly" Version="7.0.8" />

builder.Services.AddDbContextFactory<ToolsDevEntities>(
        options => options.UseSqlServer(builder.Configuration.GetConnectionString("ToolsDevEntities"), 
                           x => x.UseDateOnlyTimeOnly()).EnableDetailedErrors(true));
try
{
    using (var dx = DatabaseFactory.CreateDbContext())
    {
        var obj = new DummyModel();
        obj.Notifications = dx.TableName.Where(c => c.Key == "Key").Select(c => c.Value).SingleOrDefault().Split(',').ToList();
        return obj;
    }
}
catch (Exception e)
{
    return new DummyModel();
}

Did not found any specific documentation to fix this error, I am reaching out here, someone faces same issue or is there any solution to resolve this error ? Thanks for your help in advance.

System.MissingMethodException
HResult=0x80131513
Message=Method not found: 'Void CoreTypeMappingParameters..ctor(System.Type, Microsoft.EntityFrameworkCore.Storage.ValueConversion.ValueConverter, Microsoft.EntityFrameworkCore.ChangeTracking.ValueComparer, Microsoft.EntityFrameworkCore.ChangeTracking.ValueComparer, Microsoft.EntityFrameworkCore.ChangeTracking.ValueComparer, System.Func3<Microsoft.EntityFrameworkCore.Metadata.IProperty,Microsoft.EntityFrameworkCore.Metadata.IEntityType,Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator>)'. Source=EntityFrameworkCore.SqlServer.DateOnlyTimeOnly

I can see similar issues were resolved by @ErikEJ @roji

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions