kevin-mueller / HtmlCssClassCompletion

A Visual Studio 2022 extension, that improvies the exisiting intellisense of css classes for html-like languages.
MIT License
38 stars 2 forks source link

Scanning gives NullReferenceException #9

Closed Spaxys closed 2 years ago

Spaxys commented 2 years ago

Getting NullReferenceException when running Tools->Scan all projects for CSS classes. Using Visual Studio 2022, full program info:

Microsoft Visual Studio Community 2022 (64-bit) - Current Version 17.1.4

This is the exception I get:

System.NullReferenceException: Object reference not set to an instance of an object.
   at HtmlCssClassCompletion22.ElementCatalog.<>c__DisplayClass9_0.<<GetProjectPathsWithReferencesAsync>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.VisualStudio.Threading.JoinableTask.<JoinAsync>d__76.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at HtmlCssClassCompletion22.ElementCatalog.<GetProjectPathsWithReferencesAsync>d__9.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at HtmlCssClassCompletion22.ElementCatalog.<RefreshClassesAsync>d__8.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at HtmlCssClassCompletion22.RefreshCssClassesCommand.<ExecuteAsync>d__0.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Community.VisualStudio.Toolkit.BaseCommand.<>c__DisplayClass8_0.<<Execute>b__0>d.MoveNext()

Also saw other people having issues scanning:

Unfortunately, scanning isn't working either on startup or when I click Tools -> Scan all Projects for css classes. I'm using VS2022 and am having Blazor app with lots of css files and it would be really appreciated if your extension worked.

Originally posted by @dev-elena in https://github.com/kevin-mueller/HtmlCssClassCompletion/issues/4#issuecomment-1130485187

Spaxys commented 2 years ago

Using extension v1.12

kevin-mueller commented 2 years ago

Thanks for bringing this to my attention! I just released a new version, which simply implements more exception handling, but I don't think that will solve the underlying issue. It will likely just skip the projects that cause the issue. Better than before, but not really a good solution.

Could you perhaps upload a small sample project, where the extension fails? It works for all of my projects, so it's really hard to debugg and find the error. Would be much appreciated. @Spaxys

kevin-mueller commented 2 years ago

Closing this because of insufficient information.