Migration error for module template: Failed to initialize CoreCLR, HRESULT: 0x80004005
Is there an existing issue for this?
- [X] I have searched the existing issues
Description
Migration not working when I use module template
Reproduction Steps
To create a template I use the following command:
abp new MyModule -t module --no-ui --dbms MYSQL
For migration:
dotnet ef migrations add InitialCreate --project MyModule.csproj --context MyModuleDbContext Build started... Build succeeded. Failed to initialize CoreCLR, HRESULT: 0x80004005 <- error, googled long enough
A migrator is added if you create through an application template (ABP new MyModule -t app). On this pattern, migrations work both through the migrator and the dotnet ef migrations add command.
Expected behavior
dotnet ef migrations add command works for any template
Actual behavior
dotnet ef migrations add InitialCreate --project MyModule.csproj --context MyModuleDbContext command product error: Failed to initialize CoreCLR, HRESULT: 0x80004005
Regression?
No response
Known Workarounds
No response
Version
6.0.1
User Interface
Common (Default)
Database Provider
EF Core (Default)
Tiered or separate authentication server
Separate Auth Server
Operation System
macOS
Other information
No response
You can not add migration to a module. You can add it to the host application that uses the module.
There sample hosts to test your module; Unified as a non-tiered app, AuthServer and Http.Api.Host for a tiered app etc. Try adding migration to one of the end-application that uses the module as library.
The command mentioned above does not provide an appropriate migration factory in HttpApi.Host project. It creates a factory only for the local MSSQL database that I did not intend to use.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.