Open jepzen opened 2 days ago
Based on the exception it looks like you haven't configured any provider for your 'DbContext`. However this issue is lacking enough information for us to be able to fully understand what is happening. Please attach a small, runnable project or post a small, runnable code listing that reproduces what you are seeing so that we can investigate.
Yes ok I am not really allowed to to share my code but maybe I can clarify without. The migrations are located in the same project as the being the startup which is a WebApi with DI configured. Would it help to move migrations to another project like the Domain one? One that has not DI configured.
Or in other words. Can you run the dotnet-ef migrations bundle
without having a Db connection?
What's the working directory where you run the command? Could you try explicitly specifying --project <PROJECT>
and/or --startup-project <PROJECT>
?
For creating migrations bundle you don't need connection, but you need database provider configured (that's the Microsoft.EntityFrameworkCore.SqlServer
for example).
im running this command in my CI
dotnet-ef migrations bundle --output ./migrations-tool
But i get an error.
When I run it locally I notice that this command will connect to my database. Is that required to do this command ? If that is the reason i just dont really get the point of having this bundle command that is supposed to be CI friendly
https://devblogs.microsoft.com/dotnet/introducing-devops-friendly-ef-core-migration-bundles/
If a CI is dependent on a sql server is present
EF Core version: 8 Database provider: (e.g. Microsoft.EntityFrameworkCore.SqlServer) Target framework: (e.g. .NET 8.0) Operating system: MacOS IDE: (e.g. Jet 2022 17.4)