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
Unable to create a 'DbContext' of type ''. The exception 'No database provider has been configured for this DbContext. A provider can be configured by overriding the 'DbContext.OnConfiguring' method or by using 'AddDbContext' on the application service provider. If 'AddDbContext' is used, then also ensure that your DbContext type accepts a DbContextOptions<TContext> object in its constructor and passes it to the base constructor for DbContext.' was thrown while attempting to create an instance. For the different patterns supported at design time, see https://go.microsoft.com/fwlink/?linkid=851728
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
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)
The text was updated successfully, but these errors were encountered: