Skip to content

Unhelpful exception from AutoGeneratedProgram #599

Closed

Description

@dashesy

When I try to use DragonFly I get this exception


$ ./TesterApp.exe -h

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_WindowWidth()
   at System.CommandLine.HelpBuilder..ctor(IConsole console, Nullable`1 columnGutter, Nullable`1 indentationSize, Nullable`1 maxWidth)
   at System.CommandLine.CommandLineConfiguration.<>c.<get_HelpBuilderFactory>b__22_0(BindingContext context)
   at System.CommandLine.Invocation.ServiceProvider.GetService(Type serviceType)
   at System.CommandLine.Binding.BindingContext.get_HelpBuilder()
   at System.CommandLine.Invocation.HelpResult.Apply(InvocationContext context)
   at System.CommandLine.Invocation.InvocationPipeline.<InvokeAsync>d__2.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.CommandLine.Invocation.InvocationExtensions.<InvokeAsync>d__9.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.CommandLine.Invocation.InvocationExtensions.<InvokeAsync>d__11.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.CommandLine.DragonFruit.CommandLine.<InvokeMethodAsync>d__1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.CommandLine.DragonFruit.CommandLine.<ExecuteAssemblyAsync>d__0.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
   at AutoGeneratedProgram.<Main>d__0.MoveNext() in D:\development\ComputerVision-ImageUnderstanding\TesterApp\obj\x64\Debug\net472\TesterApp.Program.g.cs:line 10
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
   at AutoGeneratedProgram.<Main>(String[] args)

Activity

  1. dashesy commented on Jul 29, 2019

    @dashesy
    Author

    Ok I use git-bash for most of my debugging. I had to use winpty

    winpty ./TesterApp.exe -h

    I wonder why it is needed now, when I used Microsoft.Extensions.CommandLineUtils and app.Execute(args) the console was fine, but now I need pty.

  2. flcdrg commented on Aug 7, 2019

    @flcdrg
    Contributor

    Seeing the same error trying to run an application as a Windows Service

  3. added
    bug
    on Aug 7, 2019
  4. added a commit that references this issue on Aug 9, 2019
    eb82b22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions