abp icon indicating copy to clipboard operation
abp copied to clipboard

Migration error for module template: Failed to initialize CoreCLR, HRESULT: 0x80004005

Open ukod opened this issue 3 years ago • 2 comments

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

ukod avatar Dec 15 '22 17:12 ukod

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.

gterdem avatar Dec 16 '22 06:12 gterdem

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.

ukod avatar Dec 16 '22 10:12 ukod

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.

stale[bot] avatar Feb 18 '23 02:02 stale[bot]