microsoft / vscode-dotnettools

This is a feedback repository to capture issues logged for the C# Dev Kit and related extensions from Visual Studio Code
Other
231 stars 13 forks source link

The Project system ran into an unexpected problem #1456

Closed burtonrodman closed 1 month ago

burtonrodman commented 1 month ago

Type: Bug

9/10/2024 4:06:36 PM LimitedFunctionality System.AggregateException: One or more errors occurred. (Object reference not set to an instance of an object.) ---> (Inner Exception #0) System.NullReferenceException: Object reference not set to an instance of an object. at Microsoft.VisualStudio.ProjectSystem.Server.ProjectLaunchConfigurationService.g__ActionBlockCallback|25_0(IProjectVersionedValue1 data) at Microsoft.VisualStudio.ProjectSystem.ActionBlockSlimSync1.ProcessInputAsync(TInput input) at Microsoft.VisualStudio.ProjectSystem.DataReceivingBlockSlim`1.ProcessInputQueueAsync(InputDataBuffer inputQueue) <--- (Inner Exception #0)

Extension version: 1.10.16 VS Code version: Code 1.93.0 (4849ca9bdf9666755eb463db297b69e5385090e3, 2024-09-04T13:02:38.431Z) OS version: Windows_NT x64 10.0.22631 Modes:

System Info |Item|Value| |---|---| |CPUs|13th Gen Intel(R) Core(TM) i9-13900H (20 x 2995)| |GPU Status|2d_canvas: enabled
canvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled
webnn: disabled_off| |Load (avg)|undefined| |Memory (System)|31.59GB (8.11GB free)| |Process Argv|. --crash-reporter-id c8e3650d-a133-42e9-901c-3aa8e8465629| |Screen Reader|no| |VM|0%|
A/B Experiments ``` vsliv368cf:30146710 vspor879:30202332 vspor708:30202333 vspor363:30204092 vswsl492cf:30256860 vscod805:30301674 binariesv615:30325510 vsaa593cf:30376535 py29gd2263:31024239 c4g48928:30535728 azure-dev_surveyone:30548225 962ge761:30959799 pythongtdpath:30769146 welcomedialog:30910333 pythonnoceb:30805159 asynctok:30898717 pythonmypyd1:30879173 h48ei257:31000450 pythontbext0:30879054 accentitlementst:30995554 dsvsc016:30899300 dsvsc017:30899301 dsvsc018:30899302 cppperfnew:31000557 dsvsc020:30976470 pythonait:31006305 dsvsc021:30996838 jg8ic977:31013176 a69g1124:31058053 dvdeprecation:31068756 dwnewjupyter:31046869 impr_priority:31102340 refactort:31108082 pythonrstrctxt:31112756 flightc:31134773 wkspc-onlycs-t:31132770 wkspc-ranged-c:31125598 defaultse:31133495 ei213698:31121563 ```
denvifer commented 1 month ago

I have a similar problem

9/11/2024 4:00:14 PM
LimitedFunctionality
System.AggregateException: Project system data flow 'Workspace update handler 12580581' closed because of an exception: Cannot access a disposed object.
Object name: 'StreamJsonRpc.JsonRpc'.. (Cannot access a disposed object.
Object name: 'StreamJsonRpc.JsonRpc'.)
---> (Inner Exception #0) StreamJsonRpc.RemoteInvocationException: Cannot access a disposed object.
Object name: 'StreamJsonRpc.JsonRpc'.
   at StreamJsonRpc.JsonRpc.InvokeCoreAsync[TResult](RequestId id, String targetName, IReadOnlyList`1 arguments, IReadOnlyList`1 positionalArgumentDeclaredTypes, IReadOnlyDictionary`2 namedArgumentDeclaredTypes, CancellationToken cancellationToken, Boolean isParameterObject)
   at Microsoft.VisualStudio.ProjectSystem.VSCode.LanguageServices.Handlers.DynamicItemHandler.<>c__DisplayClass6_0.<<HandleProjectChangeAsync>g__ProcessAdditionsAsync|4>d.MoveNext()
--- End of stack trace from previous location ---
   at Microsoft.VisualStudio.ProjectSystem.VSCode.LanguageServices.Handlers.DynamicItemHandler.HandleProjectChangeAsync(IWorkspaceProject context, IComparable version, IProjectChangeDescription projectChange, ContextState state, ITelemetryOperation telemetryOperation, IManagedProjectDiagnosticOutputService logger)
   at Microsoft.VisualStudio.ProjectSystem.VSCode.LanguageServices.Handlers.DynamicItemHandler.HandleAsync(IWorkspaceProject context, IComparable version, IImmutableDictionary`2 projectChanges, ContextState state, ITelemetryOperation telemetryOperation, IManagedProjectDiagnosticOutputService logger)
   at Microsoft.VisualStudio.ProjectSystem.VSCode.LanguageServices.Workspace.<>c__DisplayClass43_1.<<OnEvaluationUpdateAsync>g__ProcessSourceItemsHandlersAsync|6>d.MoveNext()
--- End of stack trace from previous location ---
   at Microsoft.VisualStudio.ProjectSystem.VSCode.LanguageServices.Workspace.<>c__DisplayClass43_0.<<OnEvaluationUpdateAsync>g__ApplyProjectEvaluationAsync|2>d.MoveNext()
--- End of stack trace from previous location ---
   at Microsoft.VisualStudio.ProjectSystem.VSCode.LanguageServices.Workspace.<>c__DisplayClass46_1`1.<<OnProjectChangedAsync>g__ApplyInBatchAsync|1>d.MoveNext()
--- End of stack trace from previous location ---
   at Microsoft.VisualStudio.Threading.ReentrantSemaphore.StackSemaphore.<>c__DisplayClass3_0.<<ExecuteAsync>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at Microsoft.VisualStudio.Threading.ReentrantSemaphore.StackSemaphore.ExecuteAsync(Func`1 operation, CancellationToken cancellationToken)
   at Microsoft.VisualStudio.ProjectSystem.OnceInitializedOnceDisposedUnderLockAsync.ExecuteUnderLockCoreAsync(Func`2 action, CancellationToken cancellationToken)
   at Microsoft.VisualStudio.ProjectSystem.VSCode.LanguageServices.Workspace.OnEvaluationUpdateAsync(IProjectVersionedValue`1 evaluationUpdate)
   at Microsoft.VisualStudio.ProjectSystem.VSCode.LanguageServices.Workspace.<>c__DisplayClass42_0.<<OnWorkspaceUpdateAsync>g__ApplyUpdateWithinLockAsync|1>d.MoveNext()
--- End of stack trace from previous location ---
   at Microsoft.VisualStudio.ProjectSystem.VSCode.LanguageServices.Workspace.<>c__DisplayClass42_0.<<OnWorkspaceUpdateAsync>g__ApplyUpdateWithinLockAsync|1>d.MoveNext()
--- End of stack trace from previous location ---
   at Microsoft.VisualStudio.ProjectSystem.VSCode.LanguageServices.Workspace.<>c__DisplayClass42_0.<<OnWorkspaceUpdateAsync>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at Microsoft.VisualStudio.Threading.ReentrantSemaphore.StackSemaphore.<>c__DisplayClass3_0.<<ExecuteAsync>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at Microsoft.VisualStudio.Threading.ReentrantSemaphore.StackSemaphore.ExecuteAsync(Func`1 operation, CancellationToken cancellationToken)
   at Microsoft.VisualStudio.ProjectSystem.OnceInitializedOnceDisposedUnderLockAsync.ExecuteUnderLockCoreAsync(Func`2 action, CancellationToken cancellationToken)
   at Microsoft.VisualStudio.ProjectSystem.DataReceivingBlockSlim`1.ProcessInputQueueAsync(InputDataBuffer inputQueue)
<--- (Inner Exception #0) 

The extension has been extremely buggy and unstable over the past few days.

Version: 1.93.0
Commit: 4849ca9bdf9666755eb463db297b69e5385090e3
Date: 2024-09-04T13:02:38.431Z (1 wk ago)
Electron: 30.4.0
ElectronBuildId: 10073054
Chromium: 124.0.6367.243
Node.js: 20.15.1
V8: 12.4.254.20-electron.0
OS: Darwin arm64 23.6.0
tmeschter commented 1 month ago

@denvifer That's going to be a different problem; could you file a new bug to track that?

tmeschter commented 1 month ago

@burtonrodman Can you tell me more about your solution? E.g., what kind of projects it contains and how many?

kvenkatrajan commented 1 month ago

@arkalyanms - FYI - language service error- https://github.com/microsoft/vscode-dotnettools/issues/1456#issuecomment-2344401520

burtonrodman commented 1 month ago

@tmeschter I have a workspace referencing 8 repos, each with 2-10 C# projects (Razor Pages, Blazor SSR, Blazor Web App (global webassembly interactive), class libraries, Razor Class Library, xunit test projects, worker service. Most are net8.0, a few are still net6.0. a few NuGet package projects multi-target net6.0;net8.0. Also Aspire AppHost and ServiceDefaults.

github-actions[bot] commented 1 month ago

@tmeschter, the 'needs-more-info' label has been removed upon receiving further response from the original bug filer.

burtonrodman commented 1 month ago

also, I have a global.json in the root of each repo that pins to 8.0.400, rollForward latestMinor

dibarbet commented 1 month ago

I suspect this might be caused by https://github.com/dotnet/vscode-csharp/issues/7514

@burtonrodman - two requests

  1. Let me know if C# extension version 2.45.25 fixes the issue
  2. If it does not, please set dotnet.server.trace to Trace, and attach the 'C#' output window logs here the next time it happens.
arunchndr commented 1 month ago

closing this as fixed via https://github.com/dotnet/roslyn/pull/75046. Please reopen if the latest release still hits this issue.