Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Analyzer threw an exception #48

Open
tndata opened this issue Sep 15, 2019 · 2 comments
Open

Analyzer threw an exception #48

tndata opened this issue Sep 15, 2019 · 2 comments

Comments

@tndata
Copy link

tndata commented Sep 15, 2019

Just go this exception when I build my application.

Severity	Code	Description	Project	File	Line	Suppression State	Detail Description
Warning	AD0001	Analyzer 'SerilogAnalyzer.SerilogAnalyzerAnalyzer' threw an exception of type 'System.ArgumentOutOfRangeException' with message 'Specified argument was out of the range of valid values.
Parameter name: length'.	Infrastructure		1	Active	Analyzer 'SerilogAnalyzer.SerilogAnalyzerAnalyzer' threw the following exception:
'Exception occurred with following context:
Compilation: Infrastructure
SyntaxTree: Z:\Github\EdumentTraining\Infrastructure\Logging\Logging.cs
SyntaxNode: ExecutionLog.Fatal("{exception.Message); ... [InvocationExpressionSyntax]@[2323..2365) (62,16)-(63,0)

System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
Parameter name: length
   at Microsoft.CodeAnalysis.Text.TextSpan..ctor(Int32 start, Int32 length)
   at SerilogAnalyzer.SerilogAnalyzerAnalyzer.ReportDiagnostic(SyntaxNodeAnalysisContext& context, TextSpan& literalSpan, String stringText, Boolean exactPositions, DiagnosticDescriptor rule, MessageTemplateDiagnostic diagnostic)
   at SerilogAnalyzer.SerilogAnalyzerAnalyzer.AnalyzeSymbol(SyntaxNodeAnalysisContext context)
   at Microsoft.CodeAnalysis.Diagnostics.AnalyzerExecutor.<>c__50`1.<ExecuteSyntaxNodeAction>b__50_0(ValueTuple`2 data)
   at Microsoft.CodeAnalysis.Diagnostics.AnalyzerExecutor.ExecuteAndCatchIfThrows_NoLock[TArg](DiagnosticAnalyzer analyzer, Action`1 analyze, TArg argument, Nullable`1 info)
-----
'.

Anything I can do to help you figure out this bug?

@Suchiman
Copy link
Owner

Do you have a sample that reproduces this issue?
The snippet the exception has captured ExecutionLog.Fatal("{exception.Message); does not reproduce it for me.

@tndata
Copy link
Author

tndata commented Sep 15, 2019

Sorry, I am no longer able to reproduce it :-(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants