2

I have the following very simple powershell script

packages\EntityFramework*\tools\migrate.exe /?

when I run this script in a powershell console it shows the expected output ( lists all the possible parameters of migrate.exe )

However, when I run the same script from Teamcity using a powershell build step or even a command line build step, I get the following error

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)

enter image description here

abdullam
  • 225
  • 1
  • 3
  • 15
  • Please edit the question to copy the text of the error into the question, images aren't searchable for other people who may have the same error in future, and they can't be read by screen readers. – Nanhydrin Dec 06 '15 at 11:56
  • OK, so when you say you run it in a console, is that on the same machine as TeamCity? Is your TeamCity service running under a system account like Local Service or System, or under an actual user account? Have you tried using the full path to migrate.exe rather than a relative path? The second line in your error message does indicate it could be path related. – Nanhydrin Dec 07 '15 at 09:43
  • after opening services.msc I see 3 services which have "TeamCity" as part of their name. 1. TeamCity Build Agent, 2.TeamCity Server, and 3.TeamCity Instance inside service msc under "Log On As" column, for 1 and 2 I have .\Adminstrator and for 3 I have Network Service – abdullam Dec 07 '15 at 18:24
  • used full path and got the same error – abdullam Dec 07 '15 at 18:41
  • I'm running into a similar issue...any updates? – chillax786 Aug 19 '16 at 19:27

0 Answers0