-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Tools: Support Xamarin/MAUI Projects (currently requires separate .NET Standard class library) #7152
Comments
Just an FYI: I've been able to get tooling to work by downgrading the version in NuGet to 1.1.0-msbuild3-final, and then immediately updating it back to 1.1.0-preview4-final. Then rerun Add-Migration and gens the migration within a Xamarin Forms netstandard project. |
Anyone knows any alternative solution to this problem? |
@raky291 You should be able to create a .NET Standard Class Library to put your EF Core code in and use the tools. |
Hi @bricelam thank you To use the EntityFrameworkCore.Tools with the .NET Standard, I needed to add a console app that references my library, and set it as the startup project. |
Correct. You can also just use the class library if you edit the <TargetFrameworks>netcoreapp2.0;netstandard2.0</TargetFrameworks> |
@bricelam not true. if you set the multitargeting, the other projects (or at least the UWP, i don't have the others set to build currently) give an error |
Correct. We stopped recommending this due to poor cross-targeting support in other project types like UWP. |
Is this ever going to be worked on/fixed? the official workaround of having another project where you do migrations and then copy migrations to your project isn't very clean and i've faced issues because of it(admittedly due to my own mistakes in not copying migrations/models from .net console to xamarin app) |
Guys, what is going on with this issue ? |
@plamenkoyovchev This issue is in the Backlog milestone. This means that it is not going to happen for the 3.0 release. We will re-assess the backlog following the 3.0 release and consider this item at that time. However, keep in mind that there are many other high priority features with which it will be competing for resources. |
Actually I was able to make it work after long research over the internet.
But now I have another problem for Xamarin.iOS the lastest SQLite version in iOS 12.2 is 3.24.0 which does not support Column Renaming. SQLite has a lot of limitaions and the miss of column renaming make it useless. It is supported in 3.26.0 but I am still not able to find how to force my Xamarin app to use dll of sqlite version 3.26.0 |
You can get around this issue by opening the generated migration file and replace the migrationBuilder.RenameColumn command with the following: //Recreate table with desired new column. //now drop the old table with the wrong name ` Granted this is long and kinda annoying, but it's what you would have to do anyways if you were using a sqlite db running on a version prior to 3.25.0. Something to note is that foreign keys and indexes will also need to be taken into account when doing this process. |
@andrewndavis Thanks for this. I've successfully forced iOS to not use its embedded SQLite by doing this: (https://forums.xamarin.com/discussion/153353/how-to-use-sqlite-3-26-0-instead-of-3-24-0-in-my-xamarin-forms-ios-project/) |
Wondering if this will be addressed directly any time soon? |
@mzhukovs This issue is in the Backlog milestone. This means that it is not going to happen for the 3.0 release. We will re-assess the backlog following the 3.0 release and consider this item at that time. However, keep in mind that there are many other high priority features with which it will be competing for resources. |
So with a relatively new release of 3.1, I see this issue was going to be re-evaluated after the 3.0 release, is there hope that this will make it into the 5.0 release this November? From the general overview of the 5.0 release, there's a note under Migrations stating
Can we take this to be a resolution to this issue? To be honest, current workarounds for Xamarin.Forms have proved to be stable and quite easy to implement, but official support is always warmly welcomed. |
I jotted down some ideas for enabling this in #18840 |
I think all the 6.0 work is already tracked by #25938 |
Is this still being worked on? feels kind of weird to have separate project just for making migrations work. |
Looks like this will fall out of scope for the EF tools. We recommend always having a separate project for migrations going forward. And we'll show a warning if you don't: #32835 |
Tooling is explicitly blocked at the moment, so we'd need to do some work there to enable migrations.
The text was updated successfully, but these errors were encountered: