首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >.net核心heroku应用程序中的"dotnet-ef不存在“

.net核心heroku应用程序中的"dotnet-ef不存在“
EN

Stack Overflow用户
提问于 2020-04-13 18:51:04
回答 1查看 413关注 0票数 1

我正在使用jincod的Heroku .NET Core Buildpack将我的Core3.1MVC应用程序部署到heroku。

目前,我正在尝试通过在publish上执行命令来将EF迁移应用到postgre DB (使用Npgsql):

代码语言:javascript
复制
  <Target Name="PrePublishTarget" AfterTargets="Publish">
    <Exec Command="dotnet tool install --global dotnet-ef" />
    <Exec Command="dotnet ef database update" />
  </Target>

构建失败,并显示以下消息:

代码语言:javascript
复制
  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,但由于某种原因找不到它?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2020-04-14 16:41:40

需要添加"dotnet-tools.json“。更多信息请点击此处https://github.com/jincod/dotnetcore-buildpack/pull/104

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/61186266

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档