elishalom / netcodemetrics

Other
33 stars 13 forks source link

Exception occurs when starting up Visual Studio 2017 #6

Open slavdude opened 6 years ago

slavdude commented 6 years ago

I've been getting the following exception whenever I start up VS (15.8.3). It has only started occurring since I installed your extension. It doesn't keep me from doing work. It's just very annoying.

System.InvalidCastException: Unable to cast object of type 'ICSharpCode.NRefactory.CSharp.ReturnStatement' to type 'ICSharpCode.NRefactory.CSharp.BlockStatement'.at ICSharpCode.NRefactory.CSharp.CSharpParser.ConversionVisitor.Visit(Method m)at Mono.CSharp.Method.Accept(StructuralVisitor visitor)at Mono.CSharp.StructuralVisitor.VisitTypeDefinition(TypeDefinition tc)at ICSharpCode.NRefactory.CSharp.CSharpParser.ConversionVisitor.Visit(Class c)at Mono.CSharp.Class.Accept(StructuralVisitor visitor)at ICSharpCode.NRefactory.CSharp.CSharpParser.ConversionVisitor.Visit(NamespaceContainer ns)at Mono.CSharp.NamespaceContainer.Accept(StructuralVisitor visitor)at ICSharpCode.NRefactory.CSharp.CSharpParser.ConversionVisitor.Visit(ModuleContainer mc)at Mono.CSharp.ModuleContainer.Accept(StructuralVisitor visitor)at ICSharpCode.NRefactory.CSharp.CSharpParser.Parse(CompilerCompilationUnit top, String fileName)at ICSharpCode.NRefactory.CSharp.CSharpParser.Parse(ITextSource program, String fileName, Int32 initialLine, Int32 initialColumn)at ICSharpCode.NRefactory.CSharp.CSharpParser.Parse(ITextSource program, String fileName)at ICSharpCode.NRefactory.CSharp.CSharpParser.Parse(TextReader reader, String fileName)at CodeMetrics.Parsing.MethodsExtractor.Extract(String fileCode)at CodeMetrics.Adornments.MetricsAdornment.Init(ITextSnapshot textSnapshot)at CodeMetrics.Adornments.MetricsAdornment..ctor(IWpfTextView view, IMethodsExtractor methodsExtractor, IComplexityCalculator complexityCalculator)at CodeMetrics.Adornments.MeticsAdornmentFactory.TextViewCreated(IWpfTextView textView)at Microsoft.VisualStudio.Text.Editor.Implementation.WpfTextView.<>c__DisplayClass251_0.b__1()at Microsoft.VisualStudio.Text.Utilities.GuardedOperations.CallExtensionPoint(Object errorSource, Action call) --- End of stack trace from previous location where exception was thrown ---at Microsoft.VisualStudio.Telemetry.WindowsErrorReporting.WatsonReport.GetClrWatsonExceptionInfo(Exception exceptionObject)

elishalom commented 6 years ago

Thanks for the report. Until I'll get to fix it, you may try a fork of the project which may have fixed it: https://marketplace.visualstudio.com/items?itemName=vkacmar.RoslynCodeMetrices

elishalom commented 4 years ago

@slavdude In a "reasonable" delay :) If you're still using the extension, is there a chance you have a code that reproduces the exception?