Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

migration error efcore #1093

Closed
SAMUEL2718 opened this issue Feb 6, 2025 · 0 comments
Closed

migration error efcore #1093

SAMUEL2718 opened this issue Feb 6, 2025 · 0 comments

Comments

@SAMUEL2718
Copy link

Hello, I am new to the template, but I see a lot of work that can be used, excellent work, I have this error adding new tables, I generate the application, domain, Infrastructure layer, but I get an error in the migration as if it did not register the services.
I also have a code generator project for this template. I would like to validate what the error is and if the sourcecode generator can be improved.

Image

PM> Add-Migration InitialCreate -Context catalogdbContext -project postgresql -OutputDir Catalog
Build started...
Build succeeded.
[01:41:25 INF] server booting up..
[01:41:25 INF] configuring memory cache.
[01:41:25 FTL] Some services are not able to be constructed (Error while validating the service descriptor 'ServiceType: MediatR.IRequestHandler2[FSH.Starter.WebApi.Catalog.Application.Clientes.Maestros.Direcciones.Update.v1.UpdateDireccionesCommand,FSH.Starter.WebApi.Catalog.Application.Clientes.Maestros.Direcciones.Update.v1.UpdateDireccionesResponse] Lifetime: Transient ImplementationType: FSH.Starter.WebApi.Catalog.Application.Clientes.Maestros.Direcciones.Update.v1.UpdateDireccionesHandler': Unable to resolve service for type 'FSH.Framework.Core.Persistence.IRepository1[FSH.Starter.WebApi.Catalog.Domain.MctDirecciones]' while attempting to activate 'FSH.Starter.WebApi.Catalog.Application.Clientes.Maestros.Direcciones.Update.v1.UpdateDireccionesHandler'.) (Error while validating the service descriptor 'ServiceType: MediatR.IRequestHandler2[FSH.Starter.WebApi.Catalog.Application.Direcciones.Search.v1.SearchDireccionesCommand,FSH.Framework.Core.Paging.PagedList1[FSH.Starter.WebApi.Catalog.Application.Direcciones.Get.v1.DireccionesResponse]] Lifetime: Transient ImplementationType: FSH.Starter.WebApi.Catalog.Application.Direcciones.Search.v1.SearchDireccionesHandler': Unable to resolve service for type 'FSH.Framework.Core.Persistence.IReadRepository1[FSH.Starter.WebApi.Catalog.Domain.MctDirecciones]' while attempting to activate 'FSH.Starter.WebApi.Catalog.Application.Direcciones.Search.v1.SearchDireccionesHandler'.) (Error while validating the service descriptor 'ServiceType: MediatR.IRequestHandler2[FSH.Starter.WebApi.Catalog.Application.Direcciones.Get.v1.GetDireccionesRequest,FSH.Starter.WebApi.Catalog.Application.Direcciones.Get.v1.DireccionesResponse] Lifetime: Transient ImplementationType: FSH.Starter.WebApi.Catalog.Application.Direcciones.Get.v1.GetDireccionesHandler': Unable to resolve service for type 'FSH.Framework.Core.Persistence.IReadRepository1[FSH.Starter.WebApi.Catalog.Domain.MctDirecciones]' while attempting to activate 'FSH.Starter.WebApi.Catalog.Application.Direcciones.Get.v1.GetDireccionesHandler'.) (Error while validating the service descriptor 'ServiceType: MediatR.IRequestHandler2[FSH.Starter.WebApi.Catalog.Application.Direcciones.Create.v1.CreateDireccionesCommand,FSH.Starter.WebApi.Catalog.Application.Direcciones.Create.v1.CreateDireccionesResponse] Lifetime: Transient ImplementationType: FSH.Starter.WebApi.Catalog.Application.Direcciones.Create.v1.CreateDireccionesHandler': Unable to resolve service for type 'FSH.Framework.Core.Persistence.IRepository1[FSH.Starter.WebApi.Catalog.Domain.MctDirecciones]' while attempting to activate 'FSH.Starter.WebApi.Catalog.Application.Direcciones.Create.v1.CreateDireccionesHandler'.) (Error while validating the service descriptor 'ServiceType: MediatR.IRequestHandler1[FSH.Starter.WebApi.Catalog.Application.Direcciones.Delete.v1.DeleteDireccionesCommand] Lifetime: Transient ImplementationType: FSH.Starter.WebApi.Catalog.Application.Direcciones.Delete.v1.DeleteDireccionesHandler': Unable to resolve service for type 'FSH.Framework.Core.Persistence.IRepository`1[FSH.Starter.WebApi.Catalog.Domain.MctDirecciones]' while attempting to activate 'FSH.Starter.WebApi.Catalog.Application.Direcciones.Delete.v1.DeleteDireccionesHandler'.)
[01:41:25 INF] server shutting down..

An error occurred while accessing the Microsoft.Extensions.Hosting services. Continuing without the application service provider. Error: The entry point exited without ever building an IHost.
Unable to create a 'DbContext' of type 'catalogdbContext'. The exception 'Unable to resolve service for type 'Finbuckle.MultiTenant.Abstractions.IMultiTenantContextAccessor`1[FSH.Framework.Infrastructure.Tenant.FshTenantInfo]' while attempting to activate 'FSH.Starter.WebApi.Catalog.Infrastructure.Persistence.CatalogDbContext'.' was thrown while attempting to create an instance. For the different patterns supported at design time, see https://go.microsoft.com/fwlink/?linkid=851728

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant