razor icon indicating copy to clipboard operation
razor copied to clipboard

Razor throwing exceptions during LiveShare

Open NTaylorMullen opened this issue 2 years ago • 3 comments

Nandini mentioned that Razor in LiveShare scenarios is throwing numerous exceptions:

(StackTrace=System.InvalidOperationException: 'Projects' must be called on the project snapshot manager's thread.
   at Microsoft.CodeAnalysis.Razor.ProjectSnapshotManagerDispatcher.AssertDispatcherThread(String caller)
   at Microsoft.CodeAnalysis.Razor.ProjectSystem.DefaultProjectSnapshotManager.get_Projects()
   at Microsoft.VisualStudio.LiveShare.Razor.Host.DefaultProjectSnapshotManagerProxy.<GetLatestProjectsAsync>d__14.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.LiveShare.Razor.Host.DefaultProjectSnapshotManagerProxy.<GetProjectManagerStateAsync>d__12.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 System.Runtime.CompilerServices.TaskAwaiter.GetResult()
   at Microsoft.Cascade.Rpc.RpcDispatcher`1.<>c__DisplayClass24_2.<<CreateDispatchMethod>b__4>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 System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
   at Microsoft.Cascade.Rpc.RpcDispatcher`1.<HandleRequestAsync>d__16.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 System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult()
   at Microsoft.Cascade.Rpc.RpcSession.<RequestAsync>d__94.MoveNext())}}

Looking at the callstack it looks like our legacy LiveShare stack is spinning up in our "new" world. Technically we should be turning off our custom LiveShare behavior when the new Razor LSP editor is enabled because it "just works".

NTaylorMullen avatar Jul 08 '22 19:07 NTaylorMullen

The work item here is to turn off the Legacy Razor stuff when LiveShare is on.

ryanbrandenburg avatar Jul 14 '22 21:07 ryanbrandenburg

What is the timeline for fixing this?

nandiniYeltiwar avatar Jul 27 '22 17:07 nandiniYeltiwar

What is the timeline for fixing this?

We've de-prioritized it as for now because it doesn't seem like there's any end-user impact (it's from our legacy systems). We're prioritizing other end-user impact based work first.

NTaylorMullen avatar Jul 27 '22 17:07 NTaylorMullen