question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Crashing while editing razor files

See original GitHub issue

Environment data

dotnet SDK version: 3.0.100-preview6-012264 VS Code version: 1.35.1 C# Extension version: 1.20.0

Steps to reproduce

Edit razor files of a blazor client app. it sometimes crash.

Expected behavior

Nothing happen

Actual behavior

[Error - 5:01:26 PM] Request textDocument/completion failed.
  Message: Internal Error - System.AggregateException: One or more errors occurred. (Exception of type 'OmniSharp.Extensions.JsonRpc.Server.JsonRpcException' was thrown.) ---> OmniSharp.Extensions.JsonRpc.Server.JsonRpcException: Exception of type 'OmniSharp.Extensions.JsonRpc.Server.JsonRpcException' was thrown.
   at OmniSharp.Extensions.JsonRpc.ResponseRouter.SendRequest[T,TResponse](String method, T params)
   at Microsoft.AspNetCore.Razor.LanguageServer.DefaultRemoteTextLoaderFactory.RemoteTextLoader.LoadTextAndVersionAsync(Workspace workspace, DocumentId documentId, CancellationToken cancellationToken) in /_/src/Microsoft.AspNetCore.Razor.LanguageServer/DefaultRemoteTextLoaderFactory.cs:line 73
   at Microsoft.CodeAnalysis.Razor.ProjectSystem.DocumentState.GetTextAsync()
   at Microsoft.CodeAnalysis.Razor.ProjectSystem.DefaultProjectSnapshotManager.<>c__DisplayClass19_0.<<DocumentOpened>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at Microsoft.CodeAnalysis.Razor.ProjectSystem.DocumentState.GetTextAsync()
   at Microsoft.AspNetCore.Razor.LanguageServer.RazorDocumentSynchronizationEndpoint.Handle(DidChangeTextDocumentParams notification, CancellationToken token) in /_/src/Microsoft.AspNetCore.Razor.LanguageServer/RazorDocumentSynchronizationEndpoint.cs:line 79
   at OmniSharp.Extensions.LanguageServer.Server.Pipelines.ResolveCommandPipeline`2.Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate`1 next)
   at OmniSharp.Extensions.LanguageServer.Server.LspRequestRouter.RouteNotification(IHandlerDescriptor descriptor, Notification notification)
   --- End of inner exception stack trace ---
   at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
   at Microsoft.CodeAnalysis.Razor.ProjectSystem.DocumentState.TryGetTextVersion(VersionStamp& result)
   at Microsoft.CodeAnalysis.Razor.ProjectSystem.DocumentState.GetTextVersionAsync()
   at Microsoft.CodeAnalysis.Razor.ProjectSystem.DocumentState.ComputedStateTracker.GetGeneratedOutputAndVersionCoreAsync(DefaultProjectSnapshot project, DocumentSnapshot document)
   at Microsoft.CodeAnalysis.Razor.ProjectSystem.DefaultDocumentSnapshot.GetGeneratedOutputAsync()
   at Microsoft.AspNetCore.Razor.LanguageServer.Completion.RazorCompletionEndpoint.Handle(CompletionParams request, CancellationToken cancellationToken) in /_/src/Microsoft.AspNetCore.Razor.LanguageServer/Completion/RazorCompletionEndpoint.cs:line 100
   at OmniSharp.Extensions.LanguageServer.Server.Pipelines.ResolveCommandPipeline`2.Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate`1 next)
   at OmniSharp.Extensions.LanguageServer.Server.LspRequestRouter.RouteRequest(IHandlerDescriptor descriptor, Request request)
---> (Inner Exception #0) OmniSharp.Extensions.JsonRpc.Server.JsonRpcException: Exception of type 'OmniSharp.Extensions.JsonRpc.Server.JsonRpcException' was thrown.
   at OmniSharp.Extensions.JsonRpc.ResponseRouter.SendRequest[T,TResponse](String method, T params)
   at Microsoft.AspNetCore.Razor.LanguageServer.DefaultRemoteTextLoaderFactory.RemoteTextLoader.LoadTextAndVersionAsync(Workspace workspace, DocumentId documentId, CancellationToken cancellationToken) in /_/src/Microsoft.AspNetCore.Razor.LanguageServer/DefaultRemoteTextLoaderFactory.cs:line 73
   at Microsoft.CodeAnalysis.Razor.ProjectSystem.DocumentState.GetTextAsync()
   at Microsoft.CodeAnalysis.Razor.ProjectSystem.DefaultProjectSnapshotManager.<>c__DisplayClass19_0.<<DocumentOpened>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at Microsoft.CodeAnalysis.Razor.ProjectSystem.DocumentState.GetTextAsync()
   at Microsoft.AspNetCore.Razor.LanguageServer.RazorDocumentSynchronizationEndpoint.Handle(DidChangeTextDocumentParams notification, CancellationToken token) in /_/src/Microsoft.AspNetCore.Razor.LanguageServer/RazorDocumentSynchronizationEndpoint.cs:line 79
   at OmniSharp.Extensions.LanguageServer.Server.Pipelines.ResolveCommandPipeline`2.Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate`1 next)
   at OmniSharp.Extensions.LanguageServer.Server.LspRequestRouter.RouteNotification(IHandlerDescriptor descriptor, Notification notification)<---

  Code: -32602 

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
nkevcommented, Jul 28, 2019

I’ve posted a bit more info at aspnet/Razor.VSCode#372

0reactions
NTaylorMullencommented, Jun 27, 2019

Ahh, that helps a lot thanks for investigating further! We’re tracking the fix for this issue over here: https://github.com/aspnet/Razor.VSCode/issues/372

Read more comments on GitHub >

github_iconTop Results From Across the Web

Visual Studio Crashes during .razor file editing #4545 - GitHub
Sometimes, during the edition of a .razor file, the application hangs than crashes. This is often during editing an HTML element class.
Read more >
IDE crashes when editing razor files for Blazor
I have to constantly close VS, reload the whole solution… it works for a few builds and fails again… fixed in: visual studio...
Read more >
Razor crashing constantly while editing views - MSDN
VS 2001 SP1 crashes non-stop when editing razor views. I'm never sure what causes it. Sometimes it's fine, and then other times it...
Read more >
Visual Studio 2022 Razor Editor Crashes Occasionally
It fails to recognize these external components from NuGet packages and other source files. This problem has been around for quite a while....
Read more >
Visual Studio Gets Experimental Razor Editor for Blazor, Other ...
NET web apps based on MVC, Razor Pages, and Blazor," said Daniel Roth, ... you use Razor to author reusable UI components in...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found