Cliff Conway
Cliff Conway

Reputation: 31

Old project Upgrade to NET 9 and Microsoft.EntityFrameworkCore to V 9.0.0. Problems with Pomelo.EntityFrameworkCore.MySql V 9.0.0-preview.1

Upgraded a project I haven't amended for 18 months. Upgraded to NET 9.0, Microsoft.EntityFrameworkCore V 9.0.0 and Pomelo.EntityFrameworkCore.MySql 9.0.0-preview.1 (also tried Pomelo nightly build)

Error:-

System.TypeLoadException: 'Method 'get_LockReleaseBehavior' in type 'Pomelo.EntityFrameworkCore.MySql.Migrations.Internal.MySqlHistoryRepository' from assembly 'Pomelo.EntityFrameworkCore.MySql, Version=9.0.0.0, Culture=neutral, PublicKeyToken=2cc498582444921b' does not have an implementation.'

I have seen some similar references to this error but none of the solutions have work.

I am assuming Pomelo have not reached compatibility with Net 9 versions. Has anyone any experience of how to resolve this problem.

I have tried various solutions from similar type problems. Error still occurs

csproj:-

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <TargetFramework>net9.0</TargetFramework>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
    <DocumentationFile></DocumentationFile>
  </PropertyGroup>
  <ItemGroup>
    <Compile Remove="Luckins Data Entities\Original-LuckinsContext.cs" />
    <Compile Remove="Luckins Data Entities\supplierdetail.cs" />
  </ItemGroup>
  <ItemGroup>
    <PackageReference Include="Coravel.Pro" Version="5.2.3" />
    <PackageReference Include="EfCore.SchemaCompare" Version="7.0.0">
      <PrivateAssets>all</PrivateAssets>
      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
    </PackageReference>
    <PackageReference Include="Microsoft.EntityFrameworkCore" Version="9.0.0" />
    <PackageReference Include="Microsoft.EntityFrameworkCore.Abstractions" Version="9.0.0" />
    <PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="9.0.0">
      <PrivateAssets>all</PrivateAssets>
      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
    </PackageReference>
    <PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="9.0.0" />
    <PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="9.0.0" />
    <PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="9.0.0">
      <PrivateAssets>all</PrivateAssets>
      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
    </PackageReference>
    <PackageReference Include="MySqlConnector" Version="2.4.0" />
    <PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
    <PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="9.0.0-preview.1" />
    <PackageReference Include="PresentationFramework" Version="4.6.0" />
    <PackageReference Include="Serilog" Version="4.2.0" />
    <PackageReference Include="Serilog.Settings.Configuration" Version="9.0.0" />
    <PackageReference Include="Serilog.Sinks.MySQL" Version="5.0.0" />
    <PackageReference Include="SSH.NET" Version="2024.2.0" />
    <PackageReference Include="System.Linq.Dynamic.Core" Version="1.5.0" />
  </ItemGroup>
</Project>

Upvotes: 1

Views: 422

Answers (1)

Guru Stron
Guru Stron

Reputation: 143098

According to the issue @github the support is not yet released, but you can use the alpha.1 build (9.0.0-alpha.1.ci.20241209190142 - latest ATM) which should have been pushed several days ago:

Install-Package Pomelo.EntityFrameworkCore.MySql -Version 9.0.0-alpha.1.ci.20241209190142 -Source https://www.myget.org/F/pomelo/api/v3/index.json 

Upvotes: 1

Related Questions