Closed mitchdenny closed 6 months ago
Related #398
Note that Microsoft.EntityFrameworkCore.Design
is generally not meant to be used at runtime. It's important to avoid Aspire or the app assembly from referencing it as it could lead to trimming and NativeAOT warnings. The EF tools just need it to be located in the output directory, i.e. it's a development dependency.
Assigning to @JamesNK to look at as part of the all up database work.
EF Core splits it out into a separate package for good reasons. I don't see why components would be different.
If you need Microsoft.EntityFrameworkCore.Design
then you should add it to the project.
I'm going to close this. If people think more research or discussion is required then feel free to reopen.
If you manually wire up a DbContext and use an EF-based Aspire component and then use the EF tools to create the initial migration, EF will fail because the project doesn't have a reference to
Microsoft.EntityFrameworkCore.Design
. Should we consider pre-adding this as a transitive dependency on components that are targetting entity framework to streamline this workflow?