Entity framework 无法在Teamcity中运行migrate.exe

Entity framework 无法在Teamcity中运行migrate.exe,entity-framework,teamcity-9.0,Entity Framework,Teamcity 9.0,我有以下非常简单的powershell脚本 packages\EntityFramework*\tools\migrate.exe /? 当我在powershell控制台中运行此脚本时,它会显示预期的输出(列出migrate.exe的所有可能参数) 但是,当我使用powershell构建步骤甚至命令行构建步骤从Teamcity运行相同的脚本时,会出现以下错误 Unhandled Exception: System.IO.IOException: The handle is invalid. a

我有以下非常简单的powershell脚本

packages\EntityFramework*\tools\migrate.exe /?
当我在powershell控制台中运行此脚本时,它会显示预期的输出(列出migrate.exe的所有可能参数)

但是,当我使用powershell构建步骤甚至命令行构建步骤从Teamcity运行相同的脚本时,会出现以下错误

Unhandled Exception: System.IO.IOException: The handle is invalid.
at System.IO.__Error.WinIOError (Int32 errorCode, String maybeFullPath)
at System.Console.GetBufferInfo(Boolean throwOnNoConsole, Boolean& succeeded)
at System.Data.Entity.Migrations.Console.Program.Main(String[] args)

请编辑问题以将错误文本复制到问题中,其他人在将来可能会出现相同错误时无法搜索图像,屏幕阅读器也无法读取这些图像。好的,那么当您说在控制台中运行时,图像是否与TeamCity在同一台机器上?您的TeamCity服务是在系统帐户(如本地服务或系统)下运行,还是在实际用户帐户下运行?您是否尝试过使用完整路径而不是相对路径来迁移.exe?错误消息中的第二行表明它可能与路径相关。打开services.msc后,我看到3个服务的名称中有“TeamCity”。1.TeamCity Build Agent、2.TeamCity Server和3.TeamCity Instance inside service msc在“登录身份”列下,对于1和2,我有。\Administrator,对于3,我有网络服务使用完整路径,并遇到相同的错误我遇到类似问题…有更新吗?