I am getting this failure for a c# GitHub repo set up with automatic analysis method. I hope you can help.
Regards,
Mario
I am getting this failure for a c# GitHub repo set up with automatic analysis method. I hope you can help.
Regards,
Mario
Hi Mario,
Welcome to the community!
Can you provide the approximate date/timestamp of this failure? Having that will help us find it in our logs.
Thx,
Ann
Hi @goapp-software ,
I found these log traces. They contain an error log trace.
ERROR: System.AggregateException: One or more errors occurred. (Reference of type 'Microsoft.CodeAnalysis.VisualBasic.VisualBasicCompilationReference' is not valid for this compilation. (Parameter 'references[131]'))
---> System.ArgumentException: Reference of type 'Microsoft.CodeAnalysis.VisualBasic.VisualBasicCompilationReference' is not valid for this compilation. (Parameter 'references[131]')
at Microsoft.CodeAnalysis.Compilation.ValidateReferences[T](IEnumerable`1 references)
at Microsoft.CodeAnalysis.CSharp.CSharpCompilation.WithReferences(IEnumerable`1 references)
at Microsoft.CodeAnalysis.CSharp.CSharpCompilation.CommonWithReferences(IEnumerable`1 newReferences)
at Microsoft.CodeAnalysis.Compilation.WithReferences(IEnumerable`1 newReferences)
at Microsoft.CodeAnalysis.SolutionCompilationState.RegularCompilationTracker.<>c__DisplayClass24_0.<<GetOrBuildFinalStateAsync>g__FinalizeCompilationWorkerAsync|4>d.MoveNext()
--- End of stack trace from previous location ---
at Microsoft.CodeAnalysis.SolutionCompilationState.RegularCompilationTracker.<>c__DisplayClass24_0.<<GetOrBuildFinalStateAsync>g__FinalizeCompilationAsync|3>d.MoveNext()
--- End of stack trace from previous location ---
at Microsoft.CodeAnalysis.SolutionCompilationState.RegularCompilationTracker.<>c__DisplayClass24_0.<<GetOrBuildFinalStateAsync>g__BuildFinalStateAsync|0>d.MoveNext()
--- End of stack trace from previous location ---
at Microsoft.CodeAnalysis.SolutionCompilationState.RegularCompilationTracker.GetOrBuildFinalStateAsync(SolutionCompilationState compilationState, CancellationToken cancellationToken)
at Microsoft.CodeAnalysis.SolutionCompilationState.RegularCompilationTracker.GetCompilationSlowAsync(SolutionCompilationState compilationState, CancellationToken cancellationToken)
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
at AutoScan.NET.Build.RoslynCompiler.Compile()
at AutoScan.NET.Build.ProjectCompiler.Compile(IEnumerable`1 dependencyDllPaths)
at AutoScan.NET.Analysis.Analyze(ScannerContext context, ProjectCompiler project)
at AutoScan.NET.Analysis.Process(ProjectCompiler project)
at AutoScan.NET.Program.Analyze(String directory, AnalysisMetrics metrics, SonarQubeConfig sonarQubeConfig, ConsoleLogger logger)
at AutoScan.NET.Program.Main(String[] args)
I hope this might help.
Cheers.
Javier
Hi Mario,
Does that help?
Ann
Hi @goapp-software,
Thanks for raising this issue, it seems to be caused by a VB project being referenced from a C# project.
We thought we fixed this last year but it seems it hasn’t been fixed for all cases.
If you were able to provide us with a minimal reproduction where you keep only your C# projects referencing your VB projects. Inside those projects just an empty class Sample.
It should be enough to trigger this and it would be immensely helpful for us to track down and solve.
Thanks!