1
我創建了一個獨立的應用程序與dotnet
:在自包含的應用程序運行遷移
dotnet publish -c release
部署包中包含.NET的核心運行時本身 - 所以,如果有人想使用的應用程序 - 不需要分別安裝.net核心運行時。
但我的問題是......是否有可能將dotnet.exe
附加到部署包?
F.e. - 我的web應用程序expectes遷移的數據庫:
dotnet ef database update
此命令不能從獨立的應用程序運行(無直達dotnet.exe
)。
這種情況下的情景是什麼?我應該如何處理它?
看看這個SO帖子:http://stackoverflow.com/questions/35324156/automatically-execute-migrations-when-publishing-asp-net-core-app – Klinger
只要調用'context.Database.MigrateAsync( )'在代碼啓動過程中 – Tseng