You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
A clear and concise description of what the bug is.
To Reproduce I Tried without success creating a standalone minimal console app to reproduce, but look like trimmer is not removing the same types/properties in the same way in my application.
Create a new Console Application with NET8, with PublishTrimmed, SelfContained, PublishSingleFile, PublishReadyToRun.
Use ExceptionFormatter with a Exception with a stack trace.
ExceptionFormatter can some times throw a System.NullReferenceException when using reflection.
Unhandled exception. System.NullReferenceException: Object reference not set to an instance of an object.
at Spectre.Console.ExceptionFormatter.TryGetTupleName(ParameterInfo parameter, Type parameterType, String& tupleName) in /_/src/Spectre.Console/Widgets/Exceptions/ExceptionFormatter.cs:line 314
at Spectre.Console.ExceptionFormatter.GetParameterName(ParameterInfo parameter) in /_/src/Spectre.Console/Widgets/Exceptions/ExceptionFormatter.cs:line 280
at Spectre.Console.ExceptionFormatter.GetStackFrames(Exception ex, ExceptionSettings settings) in /_/src/Spectre.Console/Widgets/Exceptions/ExceptionFormatter.cs:line 79
at Spectre.Console.ExceptionFormatter.GetException(Exception exception, ExceptionSettings settings) in /_/src/Spectre.Console/Widgets/Exceptions/ExceptionFormatter.cs:line 22
at Program.<>c__DisplayClass0_1.<<Main>$>b__0(LiveDisplayContext ctx)
at Spectre.Console.LiveDisplay.<>c__DisplayClass15_0.<Start>b__0(LiveDisplayContext ctx) in /_/src/Spectre.Console/Live/LiveDisplay.cs:line 47
at Spectre.Console.LiveDisplay.<>c__DisplayClass17_0.<<StartAsync>b__0>d.MoveNext() in /_/src/Spectre.Console/Live/LiveDisplay.cs:line 80
--- End of stack trace from previous location ---
at Spectre.Console.LiveDisplay.<>c__DisplayClass18_0`1.<<StartAsync>b__0>d.MoveNext() in /_/src/Spectre.Console/Live/LiveDisplay.cs:line 110
--- End of stack trace from previous location ---
at Spectre.Console.Internal.DefaultExclusivityMode.RunAsync[T](Func`1 func) in /_/src/Spectre.Console/Internal/DefaultExclusivityMode.cs:line 40
at Spectre.Console.LiveDisplay.StartAsync[T](Func`2 func) in /_/src/Spectre.Console/Live/LiveDisplay.cs:line 98
at Spectre.Console.LiveDisplay.StartAsync(Func`2 func) in /_/src/Spectre.Console/Live/LiveDisplay.cs:line 78
at Spectre.Console.LiveDisplay.Start(Action`1 action) in /_/src/Spectre.Console/Live/LiveDisplay.cs:line 51
at Program.<Main>$(String[] args)
Expected behavior
No Exception when Formation a Exception.
Screenshots
Please upvote 👍 this issue if you are interested in it.
The text was updated successfully, but these errors were encountered:
rafaelsc
changed the title
Error when using C# PublishTrimmed, Trimmer can remove Types and Properties that spectre.console expects the type to have. (
Error when using C# PublishTrimmed, Trimmer can remove Types and Properties that spectre.console expects the type to have. (ExceptionFormatter)
Dec 5, 2023
Information
Describe the bug
A clear and concise description of what the bug is.
To Reproduce
I Tried without success creating a standalone minimal console app to reproduce, but look like trimmer is not removing the same types/properties in the same way in my application.
ExceptionFormatter
with a Exception with a stack trace.ExceptionFormatter
can some times throw aSystem.NullReferenceException
when using reflection.Expected behavior
Screenshots
Please upvote 👍 this issue if you are interested in it.
The text was updated successfully, but these errors were encountered: