Ends in:
2 DAYS
14 HRS
51 MIN
7 SEC
Ends in:
2 D
14 H
51 M
7 S
Open Closed

Are there any incompatibility between ABP 9.0 and MySql? #8401


User avatar
0
rafael.gonzales created
  • ABP Framework version: v9.0
  • UI Type: MVC
  • Database System: EF Core (MySQL) /
  • Tiered (for MVC) or Auth Server Separated (for Angular): no
  • Exception message and full stack trace:
  • Steps to reproduce the issue:

Can't create a clean ABP Project 9.0 or create an initial migration manually

I already installed NET 9.0 SDK, Visual Studio, Node and Yarn

Details:
Build started...
Build succeeded.
Unable to create a 'DbContext' of type 'DemoDbContext'. The exception '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.' was thrown while attempting to create an instance. For the different patterns supported at design time, see https://go.microsoft.com/fwlink/?linkid=851728"
14:26:47.729 	 Warning      	 Failed to add migration Initial.

Details:
Build started...
Build succeeded.
Unable to create a 'DbContext' of type 'DemoDbContext'. The exception '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.' was thrown while attempting to create an instance. For the different patterns supported at design time, see https://go.microsoft.com/fwlink/?linkid=851728
14:26:47.729 	 Warning      	 Code:
14:26:47.729 	 Warning      	 Details:
14:27:58.336 	 Information  	 CLI command executed. Command: "abp install-libs"
 Working directory: "C:\Users\Demo\Documents\DemoAbp" 
 CommandResult { ExitCode: 0, IsSuccess: True, StartTime: 11/29/2024 14:26:38 -05:00, ExitTime: 11/29/2024 14:27:58 -05:00, RunTime: 00:01:19.3983980 }
14:27:58.337 	 Information  	 Completed task execution: "Installing client side libraries"
07:38:56.529 	 Information  	 Received HTTP response headers after 1172.7963ms - 200
07:38:56.530 	 Information  	 End processing HTTP request after 1173.2123ms - 200

6 Answer(s)
  • User Avatar
    0
    Anjali_Musmade created
    Support Team Support Team Member

    Hello ,

    Can you provide some steps to reproduce the issue. Which node and yarn version you can use.

    Thank you

  • User Avatar
    0
    rafael.gonzales created

    Hello!

    I am using Yarn v1.22.22 and Node v18.20.5

  • User Avatar
    0
    rafael.gonzales created

    After trying to build the project. I get the following message in the output of visual studio

    1>------ Build started: Project: DemoApp.TestBase, Configuration: Debug Any CPU ------
    2>------ Build started: Project: DemoApp.Domain.Shared, Configuration: Debug Any CPU ------
    2>DemoApp.Domain.Shared -> C:\Users\DemoUser\Projects\DemoProjects\DemoApp\src\DemoApp.Domain.Shared\bin\Debug\net9.0\DemoApp.Domain.Shared.dll
    3>------ Build started: Project: DemoApp.Application.Contracts, Configuration: Debug Any CPU ------
    4>------ Build started: Project: DemoApp.Domain, Configuration: Debug Any CPU ------
    3>DemoApp.Application.Contracts -> C:\Users\DemoUser\Projects\DemoProjects\DemoApp\src\DemoApp.Application.Contracts\bin\Debug\net9.0\DemoApp.Application.Contracts.dll
    5>------ Build started: Project: DemoApp.HttpApi.Client, Configuration: Debug Any CPU ------
    6>------ Build started: Project: DemoApp.HttpApi, Configuration: Debug Any CPU ------
    1>DemoApp.TestBase -> C:\Users\DemoUser\Projects\DemoProjects\DemoApp\test\DemoApp.TestBase\bin\Debug\net9.0\DemoApp.TestBase.dll
    5>DemoApp.HttpApi.Client -> C:\Users\DemoUser\Projects\DemoProjects\DemoApp\src\DemoApp.HttpApi.Client\bin\Debug\net9.0\DemoApp.HttpApi.Client.dll
    7>------ Build started: Project: DemoApp.HttpApi.Client.ConsoleTestApp, Configuration: Debug Any CPU ------
    4>DemoApp.Domain -> C:\Users\DemoUser\Projects\DemoProjects\DemoApp\src\DemoApp.Domain\bin\Debug\net9.0\DemoApp.Domain.dll
    8>------ Build started: Project: DemoApp.Domain.Tests, Configuration: Debug Any CPU ------
    9>------ Build started: Project: DemoApp.EntityFrameworkCore, Configuration: Debug Any CPU ------
    10>------ Build started: Project: DemoApp.Application, Configuration: Debug Any CPU ------
    9>C:\Users\DemoUser\Projects\DemoProjects\DemoApp\src\DemoApp.EntityFrameworkCore\DemoApp.EntityFrameworkCore.csproj : warning NU1608: Detected package version outside of dependency constraint: Pomelo.EntityFrameworkCore.MySql 9.0.0-preview.1 requires Microsoft.EntityFrameworkCore.Relational (>= 9.0.0-preview.1.24081.2 && <= 9.0.0-preview.1.999999) but version Microsoft.EntityFrameworkCore.Relational 9.0.0 was resolved.
    9>DemoApp.EntityFrameworkCore -> C:\Users\DemoUser\Projects\DemoProjects\DemoApp\src\DemoApp.EntityFrameworkCore\bin\Debug\net9.0\DemoApp.EntityFrameworkCore.dll
    9>Done building project "DemoApp.EntityFrameworkCore.csproj".
    11>------ Build started: Project: DemoApp.DbMigrator, Configuration: Debug Any CPU ------
    11>C:\Users\DemoUser\Projects\DemoProjects\DemoApp\src\DemoApp.DbMigrator\DemoApp.DbMigrator.csproj : warning NU1608: Detected package version outside of dependency constraint: Pomelo.EntityFrameworkCore.MySql 9.0.0-preview.1 requires Microsoft.EntityFrameworkCore.Relational (>= 9.0.0-preview.1.24081.2 && <= 9.0.0-preview.1.999999) but version Microsoft.EntityFrameworkCore.Relational 9.0.0 was resolved.
    11>DemoApp.DbMigrator -> C:\Users\DemoUser\Projects\DemoProjects\DemoApp\src\DemoApp.DbMigrator\bin\Debug\net9.0\DemoApp.DbMigrator.dll
    11>Done building project "DemoApp.DbMigrator.csproj".
    7>DemoApp.HttpApi.Client.ConsoleTestApp -> C:\Users\DemoUser\Projects\DemoProjects\DemoApp\test\DemoApp.HttpApi.Client.ConsoleTestApp\bin\Debug\net9.0\DemoApp.HttpApi.Client.ConsoleTestApp.dll
    8>DemoApp.Domain.Tests -> C:\Users\DemoUser\Projects\DemoProjects\DemoApp\test\DemoApp.Domain.Tests\bin\Debug\net9.0\DemoApp.Domain.Tests.dll
    10>DemoApp.Application -> C:\Users\DemoUser\Projects\DemoProjects\DemoApp\src\DemoApp.Application\bin\Debug\net9.0\DemoApp.Application.dll
    12>------ Build started: Project: DemoApp.Application.Tests, Configuration: Debug Any CPU ------
    6>DemoApp.HttpApi -> C:\Users\DemoUser\Projects\DemoProjects\DemoApp\src\DemoApp.HttpApi\bin\Debug\net9.0\DemoApp.HttpApi.dll
    13>------ Build started: Project: DemoApp.Web.Public, Configuration: Debug Any CPU ------
    14>------ Build started: Project: DemoApp.Web, Configuration: Debug Any CPU ------
    13>C:\Users\DemoUser\Projects\DemoProjects\DemoApp\src\DemoApp.Web.Public\DemoApp.Web.Public.csproj : warning NU1608: Detected package version outside of dependency constraint: Pomelo.EntityFrameworkCore.MySql 9.0.0-preview.1 requires Microsoft.EntityFrameworkCore.Relational (>= 9.0.0-preview.1.24081.2 && <= 9.0.0-preview.1.999999) but version Microsoft.EntityFrameworkCore.Relational 9.0.0 was resolved.
    13>C:\Users\DemoUser\Projects\DemoProjects\DemoApp\src\DemoApp.Web.Public\DemoApp.Web.Public.csproj : warning NU1902: Package 'MessagePack' 2.2.85 has a known moderate severity vulnerability, https://github.com/advisories/GHSA-4qm4-8hg2-g2xm
    14>C:\Users\DemoUser\Projects\DemoProjects\DemoApp\src\DemoApp.Web\DemoApp.Web.csproj : warning NU1608: Detected package version outside of dependency constraint: Pomelo.EntityFrameworkCore.MySql 9.0.0-preview.1 requires Microsoft.EntityFrameworkCore.Relational (>= 9.0.0-preview.1.24081.2 && <= 9.0.0-preview.1.999999) but version Microsoft.EntityFrameworkCore.Relational 9.0.0 was resolved.
    14>C:\Users\DemoUser\Projects\DemoProjects\DemoApp\src\DemoApp.Web\DemoApp.Web.csproj : warning NU1902: Package 'MessagePack' 2.2.85 has a known moderate severity vulnerability, https://github.com/advisories/GHSA-4qm4-8hg2-g2xm
    12>DemoApp.Application.Tests -> C:\Users\DemoUser\Projects\DemoProjects\DemoApp\test\DemoApp.Application.Tests\bin\Debug\net9.0\DemoApp.Application.Tests.dll
    15>------ Build started: Project: DemoApp.EntityFrameworkCore.Tests, Configuration: Debug Any CPU ------
    15>C:\Users\DemoUser\Projects\DemoProjects\DemoApp\test\DemoApp.EntityFrameworkCore.Tests\DemoApp.EntityFrameworkCore.Tests.csproj : warning NU1608: Detected package version outside of dependency constraint: Pomelo.EntityFrameworkCore.MySql 9.0.0-preview.1 requires Microsoft.EntityFrameworkCore.Relational (>= 9.0.0-preview.1.24081.2 && <= 9.0.0-preview.1.999999) but version Microsoft.EntityFrameworkCore.Relational 9.0.0 was resolved.
    15>DemoApp.EntityFrameworkCore.Tests -> C:\Users\DemoUser\Projects\DemoProjects\DemoApp\test\DemoApp.EntityFrameworkCore.Tests\bin\Debug\net9.0\DemoApp.EntityFrameworkCore.Tests.dll
    15>Done building project "DemoApp.EntityFrameworkCore.Tests.csproj".
    

    It seems to be related to Pomelo.EntityFramework.Mysql that it's still in preview

    warning NU1608: Detected package version outside of dependency constraint: Pomelo.EntityFrameworkCore.MySql 9.0.0-preview.1 requires Microsoft.EntityFrameworkCore.Relational (>= 9.0.0-preview.1.24081.2 && <= 9.0.0-preview.1.999999) but version Microsoft.EntityFrameworkCore.Relational 9.0.0 was resolved.
    

    It looks like the ABP Studio - Log's Tab

    Unable to create a 'DbContext' of type 'DemoAppDbContext'. The exception '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.' was thrown while attempting to create an instance. For the different patterns supported at design time, see https://go.microsoft.com/fwlink/?linkid=851728
    06:33:21.299 Information   Failed task execution: "Database synchronization | Creating initial migrations"
    06:33:21.299 Information   ERROR: "An error has occured!"
    06:33:21.299 Information   ERROR DETAILS: "Failed to add migration Initial.
    
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    Pomelo.EntityFrameworkCore.MySql will recently release the 9.0 official version.

    Please wait for a few days. https://github.com/PomeloFoundation/Pomelo.EntityFrameworkCore.MySql/pull/1948

  • User Avatar
    0
    rafael.gonzales created

    hi

    Pomelo.EntityFrameworkCore.MySql will recently release the 9.0 official version.

    Please wait for a few days. https://github.com/PomeloFoundation/Pomelo.EntityFrameworkCore.MySql/pull/1948

    Hopefully, we will get that update this week. Could be a good idea to have a warning section in the project creation in Abp Studio for this kind of situation.s

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    You can try to add <PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="9.0.0-preview.1.24081.2" /> to your project to solve it now.

    But you better wait for the official version.

Made with ❤️ on ABP v9.1.0-preview. Updated on December 02, 2024, 12:35