You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Can't make migrations in a new MAUI Blazor project.
This issue happends with CLI and PM
I followed guides but they do not have this problem.
Steps to Reproduce
Create a new MAUI Blazor project
Install EfCore
Install EFCore.Sqlite
Install EfCore.Tools -> error
Edit csproj and change PackageReference of EfCore.Tools to:
PM> Add-Migration init
Startup project 'MauiApp1' targets platform 'Android'. The Entity Framework Core Package Manager Console Tools don't support this platform. See https://aka.ms/efcore-docs-pmc-tfms for more information.
PM> add-migration init
Build started...
Build succeeded.
Startup project 'MauiApp1' targets platform 'Android'. The Entity Framework Core Package Manager Console Tools don't support this platform. See https://aka.ms/efcore-docs-pmc-tfms for more information.
The text was updated successfully, but these errors were encountered:
If you follow the link from the error message you will get to a page that explains the situation pretty well. This is not supported. The official guidance here is to create a separate library/project that you can use to get around this. I will paste the text that is currently in that link here for reference.
When that still causes issues, please open an issue with the Entity Framework project. Thanks!
The Package Manager Console tools work with .NET Core or .NET Framework projects. Apps that have the EF Core model in a .NET Standard class library might not have a .NET Core or .NET Framework project. For example, this is true of Xamarin and Universal Windows Platform apps. In such cases, you can create a .NET Core or .NET Framework console app project whose only purpose is to act as startup project for the tools. The project can be a dummy project with no real code — it is only needed to provide a target for the tooling.
Why is a dummy project required? As mentioned earlier, the tools have to execute application code at design time. To do that, they need to use the .NET Core or .NET Framework runtime. When the EF Core model is in a project that targets .NET Core or .NET Framework, the EF Core tools borrow the runtime from the project. They can't do that if the EF Core model is in a .NET Standard class library. The .NET Standard is not an actual .NET implementation; it's a specification of a set of APIs that .NET implementations must support. Therefore .NET Standard is not sufficient for the EF Core tools to execute application code. The dummy project you create to use as startup project provides a concrete target platform into which the tools can load the .NET Standard class library.
Description
Can't make migrations in a new MAUI Blazor project.
This issue happends with CLI and PM
I followed guides but they do not have this problem.
Steps to Reproduce
Startup project 'MauiApp1' targets platform 'Android'. The Entity Framework Core Package Manager Console Tools don't support this platform. See https://aka.ms/efcore-docs-pmc-tfms for more information.
Link to public reproduction project repository
https://github.com/MessiasRu/MauiBlazorEfIssue
Version with bug
6.0.400
Last version that worked well
Unknown/Other
Affected platforms
Android, I was not able test on other platforms
Affected platform versions
10.0.19041.0
Did you find any workaround?
No response
Relevant log output
The text was updated successfully, but these errors were encountered: