CleanArchitectureWithBlazorServer icon indicating copy to clipboard operation
CleanArchitectureWithBlazorServer copied to clipboard

how to you recommend using this solution against an existing database?

Open dMiracleMan opened this issue 2 years ago • 5 comments

For the purpose of migrating an existing application.

Thanks.

dMiracleMan avatar Aug 28 '22 12:08 dMiracleMan

Refering to data migration, the solution works fine whene i run it from VS but whene i publish it and deploy it in IIS i got an error on Program.cs on line 56 .

how can i solve it pls ?

Thanks

alibenchaabene avatar Sep 10 '22 09:09 alibenchaabene

show me error log

neozhu avatar Sep 10 '22 11:09 neozhu

Capture

alibenchaabene avatar Sep 10 '22 15:09 alibenchaabene

Delete Migrations folder inside your project. Set Database.SetInitializer<DatabaseContext>(null); inside your DatabaseContext initializer. Delete the table __MigrationHistory inside your database. For EF6+ the table is located under Tables but for earlier versions it is located under System Tables. Build and run. Profit.

neozhu avatar Sep 10 '22 23:09 neozhu

Since @neozhu answered this question a few months ago, and nobody replied since then, this issue is considered solved.

Bram1903 avatar May 04 '23 09:05 Bram1903