我正在使用jincod的Heroku .NET Core Buildpack将我的Core3.1MVC应用程序部署到heroku。
目前,我正在尝试通过在publish上执行命令来将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,但由于某种原因找不到它?
发布于 2020-04-14 16:41:40
需要添加"dotnet-tools.json“。更多信息请点击此处https://github.com/jincod/dotnetcore-buildpack/pull/104
https://stackoverflow.com/questions/61186266
复制相似问题