0

I have an old executables wrote in c#.
It works fine in scheduled task, but not under Control-M.

When scheduled as job (job type: OS, a simple command)

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.Console.get_WindowHeight() at myprogram.Program.Main(String[] args)

It seems to crash due to an interaction with screen: get_WindowHeight
There is a way I can make it works without changing source code?

user_0
  • 3,173
  • 20
  • 33

1 Answers1

1

It's likely failing because there is no actual console window. Since you can't get the height of a window that doesn't exist (which will throw an exception) then you'll need to either find the source for the original application and re-build it to not require one, or find a way for your automation tool to create an actual console window.

PhonicUK
  • 13,486
  • 4
  • 43
  • 62