problem with entityframework migration
error: An error occurred while accessing the Microsoft.Extensions.Hosting services. Continuing without the application service provider. Error: Failed to load configuration from file 'C:\Users\peter\source\repos\BlazingBlog\BlazingBlog\appsettings.json'.
Unable to create a 'DbContext' of type ''. The exception 'Unable to resolve service for type 'Microsoft.EntityFrameworkCore.DbContextOptions`1[BlazingBlog.Data.BlogContext]' while attempting to activate 'BlazingBlog.Data.BlogContext'.' was thrown while attempting to create an instance. For the different patterns supported at design time, see https://go.microsoft.com/fwlink/?linkid=851728
code:
2 Replies
U need to fix first error message to make a migration
If you have errors in ur project, u cant make migration
Try the below points to resolve the errors.
1. If the appsettings.json is missing, try creating it.
2. Try checking the format of appsettings.json.
3. Check and Install the missing EntityFrameworkCore nuget packages.