-
Notifications
You must be signed in to change notification settings - Fork 15
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
Add support for .NET Core 3.0 #67
Comments
Hi @marchy, I haven't yet, but I wanted to start on this because the standing about an official tool for 3.0 is still vague, but had no time so far. Thank you for starting this. Gonna look into it today. EDIT: I'm a bit ahead and I think I can get it to work but there are a couple of problems I'll share in a bit. |
So good news, I got a prototype fully working. BTW, one foundational part about this transition to .NET Core 3.0 is that we don't need to do any dispatching anymore because we're always in the context of netcore. I'm glad this overhead is gone but it'll require a lot of refactoring. Also, I see that Anyway, couple of problems/worries. Resources are all messed up in this release. I'm not sure exactly who's responsible but I had to manually edit (in addition to adding DependentUpon in the csproj) the designer cs files (*.Designer.cs). For example, one old resource id was: Not sure what to do here, as both those changes (DependentUpon and Designer files) require changes in the consumer's project, in which I have no control. If I could go back I would have completely dropped this resx thing and just used plain files.. I had to write a simple impl of I know I said we don't need dispatching anymore, but I'm a bit worried. I haven't interacted with cli tools for quite some time so I don't know exactly, but if the consumer project is using a different version of .net core than what I've built against, would that still work without dispatching? Not sure. (I removed the other samples and kept only the basic console app until I can iron this out.) I pushed to netcore-3.0 branch. |
Hi Mohammad, trying to test this out, got the global tool installed but this is what I get running on our project:
Any thoughts? Not sure if this has to do with the 'Remove everything EF Core related' step or the change in dispatching, but the project has had EF Core and EF6 side by side with all the previous versions of EF6.Migrator, simply pointing to the right context with the -c option. Could we get a branch up where it uses the dispatching approach still? |
Just to know if this is related to your machine or the project, could you run it on the BasicConsoleApp sample in this repo and let me know if it works or not? |
@mrahhal it seems to run fine on the BasicConsoleApp. I'm unfamiliar with the differences between the dispatching and not, but it feels like it could be the culprit. Any way you can get a branch up where it uses the previous dispatching approach so I can see if it makes a difference? I tried to get it working (branch: https://github.com/marchy/Migrator.EF6/commits/netcore-3.0-dispatch) but the
|
Sorry for being late. Checked your changes a bit. Keeping NET46 preprocessors won't do, they're not needed, but probably not the reason there's a problem. I'll see if I can get a branch with only the necessary dispatching code so that you can try that. |
Ah. While looking at the dispatching code, the idea that dispatching shouldn't be needed is becoming more tangible. I'm not sure I can get dispatching to work at all after the required changes in .net 3.0.
That's because the tool now is a global cli tool, so yeah that's normal. Looking a bit into the ef core tool, I just can't find any mention of dispatching either. So, I might have to try to debug through the first problem you mentioned of not being able to load files, in a new project or something. |
Hmm okay thanks for looking further into that (non)option =) Let me see if I can set up a barebones project where I can reproduce the initial problem. Priorities are a bit tight right now though so we might have to revisit this again in October. Guess it's a no-go on the 3.0 update for the time being 😞 |
😞😞😞 |
Hello @mrahhal |
Hello @RedaAouad Almost no way this can work anymore, sorry 😞 But I think there's a way by using a new official tool called ef6.exe directly. You do this by updating your EntityFramework version to 6.4.0. After you do, this ef6.exe tool will be at "%USERPROFILE%\.nuget\packages\EntityFramework\6.4.0\tools\net45\any\ef6.exe". This means using this
Here is its source: https://github.com/dotnet/ef6/tree/master/src/ef6. But for some reason I can't find documentation for it. |
@RedaAouad let me know if that ends up working for you. |
It works fine. You should also add
Also, thanks for the tip about the need to have a models project that has no dependencies on anything aspnetcore-related. Otherwise, the Ref: https://github.com/mrahhal/Migrator.EF6/blob/master/README.md
Thanks 👍 |
Great stuff guys! We ended up going down the path of porting over our models into EF Core side-by-sides (probably something worth its own blog post) as we couldn't get ourselves unstuck from this. We ended up moving everything to a '.OLD' namespace and mapping everything from scratch in EF Core as to make the migration scripts match the existing EF6 tables perfectly. This ended up working for everything other than TPT-related tables/entities, which we left as being consumed only by EF6 models (ugly... but works). With TPT finally out yesterday in, we can now proceed to take on the rest of the migration that was blocked off – and move life over fully to EF Core. Hope when the time comes this helps! |
Uf, sounds tough. But good you got it working. Yeah I think it's best to just bite the bullet and try and migrate to EFCore when it's possible.
Yeah, definitely won't happen if the past is anything to judge by 😅 I'm just glad that there was at least an official ef6.exe that works. I'll be closing this as this tool is now invalid for post .net core 2. Later I'll update the README to guide the move to ef6.exe. @marchy thank you for tagging along! |
Hi @mrahhal, I'm starting this out as a way to assess the viability of running Migrator.EF6 on .NET Core 3.0.
I tried upgrading the project to .NET Core 3.0 (work-in-progress commit here) but ran into the following issues:
Issues
ISSUE 1:
Looked into this and it turned out to be caused by looking for the 'dotnet-ef6.exe', where for some reason in the .NET Core 3.0 version it generates it as a DLL ('dotnet-ef6.dll'). I'm not sure if there's a right way to generate an executable for this, but just hard-coding it to .dll for NETCOREAPP got things to the next issue:
ISSUE 2:
Let me know if you've tried and have gotten any further on this.
With the imminent release of .NET Core 3.0 perhaps we can give the EF team some feedback on how feasible migrating the current Migrator.EF6 is and what issues it's running into which they may be able to jump in and assess further.
The text was updated successfully, but these errors were encountered: