【发布时间】:2021-07-23 20:39:33
【问题描述】:
当前设置:
- 运行 Ubuntu 18 的服务器
- TeamCity Professional 2019.2(内部版本 71499)
我正在设置构建任务以使用以下命令生成 SQL 迁移脚本:
dotnet ef migrations script --output "script.sql" --context MyContext
但是,在 TeamCity 上运行构建时,构建失败并出现以下错误:
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.
Process exited with code 1
如果我通过 TeamCity 服务器上的 Ubuntu shell 运行该命令,它运行没有问题,但是当通过 TeamCity 本身运行它时,我会收到上述错误消息。我需要告诉 TeamCity dotnet 的安装位置吗?如果是在哪里?
构建步骤设置如下:
运行器类型:命令行
运行:自定义脚本
自定义脚本:dotnet ef migrations script --output "script.sql" --context MyContext
【问题讨论】:
-
即使我得到相同的结果?还没有答案吗?太可怕了!
标签: .net teamcity entity-framework-migrations