【发布时间】:2020-04-14 16:41:39
【问题描述】:
我正在使用 jincod 的 Heroku .NET Core Buildpack 将我的 Core 3.1 MVC 应用程序部署到 heroku。
目前我正在尝试通过在发布时执行命令将 EF 迁移应用到 postgre DB(使用 Npgsql):
<Target Name="PrePublishTarget" AfterTargets="Publish">
<Exec Command="dotnet tool install --global dotnet-ef" />
<Exec Command="dotnet ef database update" />
</Target>
构建失败并显示以下消息:
You can invoke the tool using the following command: dotnet-ef
Tool 'dotnet-ef' (version '3.1.3') was successfully installed.
Could not execute because the specified command or file was not found.
Possible reasons for this include:
* You misspelled a built-in dotnet command.
* You intended to execute a .NET Core program, but dotnet-ef does not exist.
* You intended to run a global tool, but a dotnet-prefixed executable with this name could not be found on the PATH.
/tmp/build_35cf57c00fbf62634ac8d644c6e8f4f7/BugTracker.csproj(38,5): error MSB3073: The command "dotnet ef database update" exited with code 1.
! Push rejected, failed to compile ASP.NET Core app.
! Push failed
我明确安装了 dotnet-ef,但由于某种原因找不到它?
【问题讨论】:
标签: postgresql asp.net-core heroku entity-framework-core