-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
EF Core 2.1 Preview 1 throws MissingMethodException when using Pomelo.EntityFrameworkCore.MySql #11078
Comments
@AdamDotNet Thanks for reporting this. It is happening because the MySQL provider is making use of EF Core internal code--I filed this issue for that: PomeloFoundation/Pomelo.EntityFrameworkCore.MySql#497 From the EF side, we will discuss in triage whether or not to revert this change to the internal code, but the long term solution is for the provider to stop using internal code. |
@ajcvickers Thanks for pointing this out and writing up the issue with the PomeloFoundation! |
Thanks for reporting this. I ran into this too and was getting ready to file an issue. I wasn't sure if providers would need to be updated to work with the new 2.1 update. Theoretically, minor revision number changes don't have breaking changes, but, I figured an update would probably be needed. The Npgsql provider seemed to have a different issue, but, luckily there is a preview release of that provider that fixed that issue. |
I wonder if Oracle's MySQL provider works? I switched to Pomelo awhile back because Oracle was taking a long time getting their provider to work. Maybe it is better now. |
@jemiller0 great to hear Npgsql is working ok for you on 2.1.0-preview1! Although it might be interesting what problem the 2.0 version of the provider had with the 2.1 version of the core. |
@roji Thanks for the great work that you've been doing with the Npgsql providers. I know that I can always count on you to be right on top of things. You always seem to be in lockstep with the EF team at Microsoft. I was using the 2.0.1 provider and ran into the following exception. For some reason the Y in
The query being run is.
|
Oracle's 2.0 provider does this, using the same code in the OP:
A more complex model will throw this:
Stack traces omitted for brevity That thoroughly sounds like Oracle's problem, not EF, so I don't know if the EF team wants a new issue opened for Oracle's provider or not, given their statement regarding 2.0 providers should work on 2.1 EF. @ajcvickers will you provide guidance? |
@jemiller0 ok thanks - yeah, that's a known issue. (and thanks for the kind words!) |
@AdamDotNet Yes, please file an issue with Oracle. Providers really need to avoid using internal code because they need to keep working after EF Core updates. |
Oracle bug report: https://bugs.mysql.com/bug.php?id=89855 |
@ajcvickers I haven't looked at the code, but, could you make it so that the internal packages are use the C# internal or private keywords to prevent people from using them? I'm assuming there is probably a reason you haven't already done this. If not, maybe you can make them inaccessible to prevent providers from doing this in the future. |
@jemiller0 I wrote a blog post on it a while ago: https://blog.oneunicorn.com/2016/11/09/internal-code-in-ef-core-1-1/ In general I think that having internal code available to use is working well for application-level development. The problem is provider writers need to be more diligent and understand the consequences. I'm hoping that we can work through this and we are not forced to take away access to internal code, but certainly if it causes enough problems, then that's what we will have to do. |
@ajcvickers Please dont!! - but provide clear provider guidance/advise |
@ErikEJ We do need to be better about communicating changes to provider writers. I chatted with Shay about this when he was here--it would be good to hear your thoughts. Are you at the summit next week? |
Yes, I am 😎 |
Hi everyone Thanks in advance. |
@gsaldana The Pomelo MySQL provider is currently not working with EF Core 2.1. We are looking into potential ways that we can help with this, but we don't have concrete plans yet. |
Is there an open ticket we can track to stay current on this? Thanks |
Well this is concerning. |
Oh no... I also got this after upgrading to EFCore 2.1. Monitoring this: https://bugs.mysql.com/bug.php?id=89855 |
@sam-wheat @AdamDotNet @rizamarhaban We have been working with the MySQL provider guys to update the provider to work with 2.1. There are a few issues that they still want to resolve before releasing. Work is being tracked by them here: PomeloFoundation/Pomelo.EntityFrameworkCore.MySql#514 |
@ajcvickers Thank you for the update. I am not clear about the relationship between Pomelo and Oracle. So when you say "the MySQL provider guys" do you also mean Oracle? I am referring to the MySQL client provided here. If they are a separate entity from Pomelo do you know if they will eventually be supporting EF 2.1? |
@sam-wheat I haven't seen any activity in a long time related to the MySQL provider from Oracle. Your best bet is to contact them and ask. |
I have the same issue after updating to |
@OmarElMallahy Pomelo is completely separate from Oracle, and currently neither have production releases that work for EF Core 2.1. However, Pomelo recently released a 2.1 compatible release candidate.
|
What is the temporary/permanent fix for this? I'm trying to create a webapi on .net core and entity framework is not able to create the database. Is the fix to not use migrations for now? |
@pmmcmullen94 Permanent fix: wait until Pomelo's or Oracle's 2.1 provider releases production quality builds. (You might be waiting a while for Oracle's, in my opinion.) |
hit with same problem today.. I guess we'll stick to 2.0 for the meantime.. |
@AdamDotNet why temporary? the option 2 it work for me |
@DanteDiaz only temporary in that when the production release is available, one should stop using the pre-release build. I'm glad the pre-release build is working for you in the meantime! |
Same problem here after update project to asp.net 2.1. So I change
|
I have same problem. |
Thank you for your information. I mistook the context initialize. Thanks. |
Uegomgom, just so I understand, your second line of code is using Pomelo, right? I ask because using the MySQL provider is ...UseMySQL. Pomelo's is ...UseMysql (note caps change). So, the release candidate for the Pomelo provider works with EF 2.1? |
The release version 2.1.1 of Pomelo is out now. I found it on NuGet this morning. |
@rchrismon yes, that is correct. There is a slight difference in some of the naming between Pomelo and the official MySQL libraries. Nothing too far off though |
@rchrismon, Yes. your understand is right. I'm using Pomelo. And Pomelo is working on my EF2.1. |
This issue still exists in Pomelo.EntityFrameworkCore.MySql 2.1.2 with Microsoft.EntityFrameworkCore (2.1.2) |
The 'MySqlDecimalTypeMapping' does not support value conversions. Support for value conversions typically requires changes in the database provider. |
Replace Nuget Package MySql.Data.EntityFrameworkCore with MySql.EntityFrameworkCore Scaffold-DbContext "server=127.0.0.1;database=chama;user=root;treattinyasboolean=true;" MySql.EntityFrameworkCore -ContextDir Models/Contexts/ -OutputDir Models/Repositories/ -UseDataBaseNames -Verbose |
After reading that EF Core 2.1 Preview 1 became available on Nuget, I wanted to if GroupBy SQL translation would just work using a 2.0 provider. My test didn't get far, however, and something as simple as
ToListAsync
throws an exception. Provider details are at the bottom.The article stated:
That's why I am here.
Steps to reproduce
Further technical details
EF Core version: "Microsoft.EntityFrameworkCore.Relational" Version="2.1.0-preview1-final"
Database Provider:
"Pomelo.EntityFrameworkCore.MySql" Version="2.0.1"
"MySqlConnector" Version="0.36.0"
Operating system: Windows 10 16299.248 x64
IDE: Visual Studio 2017 15.5.7
The text was updated successfully, but these errors were encountered: