As one of my deployment steps, I package up a SimpleMigrations project to migrate the database. It runs fine locally and when executed from Powershell on the Tentacle (running Windows Server 2016, dotnetcore 1.1), but when included as a deployment step, it fails.
If I run the script directly from Calamari with calamari --run-script --script deploy.ps1
I get the same exception.
The deploy.ps1 is:
dotnet <redacted>.dll up
The exception is:
System.IO.IOException: The handle is invalid
at System.ConsolePal.GetBufferInfo(Boolean throwOnNoConsole, Boolean& succeeded)
at System.ConsolePal.get_WindowWidth()
at SimpleMigrations.Console.ConsoleLogger.WriteHeader(String message)
at SimpleMigrations.SimpleMigrator`2.MigrateTo(Int64 newVersion)
at <redacted>(List`1 args)
at <redacted>(String[] args)
I’ve isolated it down to the call to Console.WindowWidth
.
I’m not sure if this is a problem with dotnet CLI, Powershell, Calamari or something else.