Running tool in Azure Pipelines will throw exception
See original GitHub issueWhen running the tool in Azure Pipelines to inspect my repository it throws the following exception:
Command I run:
dotnet affected -p $(System.DefaultWorkingDirectory) --from origin/develop generate --output $(System.DefaultWorkingDirectory)\changed.proj
Unhandled exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
---> System.NullReferenceException: Object reference not set to an instance of an object.
at System.CommandLine.Rendering.Views.ScreenView.Render(Region region)
at Affected.Cli.Views.ViewRenderingContext.Render(View rootView) in C:\Projects\dotnet-affected\src\dotnet-affected\Views\ViewRenderingContext.cs:line 29
at Affected.Cli.Commands.GenerateCommand.GenTraversalHandler(IConsole console, String output, CommandExecutionData data, ViewRenderingContext renderingContext) in C:\Projects\dotnet-affected\src\dotnet-affected\Commands\GenerateCommand.cs:line 71
--- End of inner exception stack trace ---
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor, Boolean wrapExceptions)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.Delegate.DynamicInvokeImpl(Object[] args)
at System.Delegate.DynamicInvoke(Object[] args)
at System.CommandLine.Invocation.ModelBindingCommandHandler.InvokeAsync(InvocationContext context)
at System.CommandLine.Invocation.InvocationPipeline.<>c__DisplayClass4_0.<<BuildInvocationChain>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass23_0.<<UseParseErrorReporting>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass16_0.<<UseHelp>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass27_0.<<UseVersionOption>b__1>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass25_0.<<UseTypoCorrections>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<UseSuggestDirective>b__24_0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass22_0.<<UseParseDirective>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass11_0.<<UseDebugDirective>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<RegisterWithDotnetSuggest>b__10_0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass14_0.<<UseExceptionHandler>b__0>d.MoveNext()
It looks like the System.CommandLine.Rendering package cannot handle the way that Azure DevOps handles the stdout.
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
Troubleshoot pipeline runs - Azure DevOps
You can view logs by navigating to the pipeline run summary and selecting the job and task. If a certain task is failing,...
Read more >Installing .NET Core tools: Preventing errors in your Azure ...
Installing .NET Core tools: Preventing errors in your Azure Pipelines. ... NET Core will throw an error and exit with a non-zero exit...
Read more >Azure Piplines throw error when running tests in .net core ...
The Microsoft.NET.Test.Sdk package relates with the code coverage. If we remove this package, the test will fail. We can try again by using...
Read more >Azure DevOps YAML Pipelines: Nine Features You Should ...
If one of the scripts within your pipelines fails or throws an exception, the email communication and run summary page for the pipelines...
Read more >Continue Azure Pipeline on failed task
If you want to continue the release even the Cypress task failed, just add to the Cypress task this line: continueOnError: true.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
All right, managed to reproduce it in this GitHub build.
The fix came from here
Hi @leonardochaia, no worries. I have both tried
Region.EntireTerminal
andRegion.Scrolling
. When I find the time I can try to extract a simplified reproduction of the issue and raise an issue with the CommandLine.Rendering folks. I’ll reference this issue to keep track. I agree that the code looks much cleaner this way.