如何解决dotnet-ef迁移是否在GITLAB中不起作用?
我正在使用GITLAB持续集成。这是从.gitlab-ci.yml
来的:
variables:
MSSQL_HOST: microsoft-mssql-server-linux
ACCEPT_EULA: Y
SA_PASSWORD: StrongPass1234
services:
- microsoft/mssql-server-linux
image: mcr.microsoft.com/dotnet/core/sdk:3.1
stages:
- build_models_api
build_models_api:
stage: build_models_api
script:
- "cd /builds/Myproject/APP/AppManagement.Api"
- "dotnet restore"
- "dotnet build"
- "dotnet tool install --global dotnet-ef"
- "export PATH='$PATH:/root/.dotnet/tools'"
- "dotnet-ef migrations add initialmigration"
- "dotnet-ef database update"
但是命令dotnet-ef migrations add initialmigration
返回以下错误:no such file or directory
:
$ export PATH='$PATH:/root/.dotnet/tools'
$ dotnet-ef migrations add initialmigration
System.ComponentModel.Win32Exception (2): No such file or directory
at System.Diagnostics.Process.ForkAndExecProcess(String filename,String[] argv,String[] envp,String cwd,Boolean redirectStdin,Boolean redirectStdout,Boolean redirectStderr,Boolean setCredentials,UInt32 userId,UInt32 groupId,UInt32[] groups,Int32& stdinFd,Int32& stdoutFd,Int32& stderrFd,Boolean usesTerminal,Boolean throwOnNoExec)
at System.Diagnostics.Process.StartCore(ProcessStartInfo startInfo)
at System.Diagnostics.Process.Start()
at System.Diagnostics.Process.Start(ProcessStartInfo startInfo)
at Microsoft.EntityFrameworkCore.Tools.Exe.Run(String executable,IReadOnlyList`1 args,String workingDirectory,Boolean interceptOutput)
at Microsoft.EntityFrameworkCore.Tools.Project.FromFile(String file,String buildExtensionsDir,String framework,String configuration,String runtime)
at Microsoft.EntityFrameworkCore.Tools.RootCommand.Execute()
at Microsoft.EntityFrameworkCore.Tools.Commands.CommandBase.<>c__DisplayClass0_0.<Configure>b__0()
at Microsoft.DotNet.Cli.CommandLine.CommandLineApplication.Execute(String[] args)
at Microsoft.EntityFrameworkCore.Tools.Program.Main(String[] args)
No such file or directory
ERROR: Job failed: exit code 1
有人遇到过这样的错误吗?谢谢您的帮助。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。