Hi,
I am getting following error while running Migration project
Castle.MicroKernel.Handlers.HandlerException: 'Can't create component 'GrowthPlan.GrowthPlanCoreModule' as it has dependencies to be satisfied.
'GrowthPlan.GrowthPlanCoreModule' is waiting for the following dependencies:
- Service 'Microsoft.AspNetCore.Hosting.IWebHostEnvironment' which was not registered.
'
Also what connection string should I specify in app settings for Migrator project (source or destination database)?
Thanks in advance.
4 Answer(s)
-
0
Hi @csona
Is this happening in the default 10.2 project ? Could you try that ? Migrator project shouldn't use IWebHostEnvironment at all.
Also what connection string should I specify in app settings for Migrator project (source or destination database)?
There is no source database in AspNet Zero. Migrator project applies migrations in your project to target database. So, it is the target database.
Thanks,
-
0
Hi @ismcagdas,
Thanks for the reply.
Regarding database connection string in appsettings.json, it is clear now. Thanks.
Regarding the other error, it is not occuring in the default 10.2 project. The error is thrown before {ProjectName}CoreModule.PreInitialize method is called. So I am trying to check the dependencies in {ProjectName}.Core project and its dependencies. Could there be any other reason it is trying to load 'Microsoft.AspNetCore.Hosting.IWebHostEnvironment'?
The dependencies for {ProjectName}.EntityFrameworkCore is as follows:
Thanks.
-
0
Hi @ismcagdas
I have resolved this issue by removing an unwanted dependency on IWebHostEnvironment in {ProjectName}CoreModule.cs that was added by mistake.
However, I had misinterpreted the use of Migrator project. Actually I would like to migrate the data from one daabase to another. Normal processes like backup & restore or import/export of data would not work due to referntial integrity constraints. Can you please recommend any way to achieve this?
Thanks in advance.
-
0