Features crash frequently - Hard Crashes of Visual Studio

When working with the extension, I’m seeing a lot of errors and crashes that cause text highlighting, auto completion and code formatting break.

Razor SemanticTokens feature is currently unavailable due to an internal error:

StreamJsonRpc.RemoteInvocationException: End: (271,0) matches or exceeds SourceText boundary 270.
at StreamJsonRpc.JsonRpc.d__1711.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.Threading.Tasks.ValueTask1.get_Result()
at Microsoft.CodeAnalysis.Remote.BrokeredServiceConnection1.<TryInvokeAsync>d__181.MoveNext()
RPC server exception:
System.InvalidOperationException: End: (271,0) matches or exceeds SourceText boundary 270.
at Microsoft.AspNetCore.Razor.ThrowHelper.ThrowInvalidOperationException[T](String message)
at Microsoft.CodeAnalysis.Text.SourceTextExtensions.g__GetAbsoluteIndex|25_0(SourceText text, Int32 line, Int32 character, String name)
at Microsoft.CodeAnalysis.Text.SourceTextExtensions.GetTextSpan(SourceText text, Int32 startLine, Int32 startCharacter, Int32 endLine, Int32 endCharacter)
at Microsoft.CodeAnalysis.Text.SourceTextExtensions.GetTextSpan(SourceText text, LinePosition start, LinePosition end)
at Microsoft.CodeAnalysis.Razor.SemanticTokens.AbstractRazorSemanticTokensInfoService.GetSemanticTokensAsync(DocumentContext documentContext, LinePositionSpan span, Guid correlationId, Boolean colorBackground, CancellationToken cancellationToken)
at Microsoft.CodeAnalysis.Razor.SemanticTokens.AbstractRazorSemanticTokensInfoService.GetSemanticTokensAsync(DocumentContext documentContext, LinePositionSpan span, Boolean colorBackground, Guid correlationId, CancellationToken cancellationToken)
at Microsoft.CodeAnalysis.Remote.Razor.RemoteSemanticTokensService.GetSemanticTokensDataAsync(RemoteDocumentContext context, LinePositionSpan span, Boolean colorBackground, Guid correlationId, CancellationToken cancellationToken)
at Microsoft.CodeAnalysis.Remote.RemoteWorkspace.<>c__DisplayClass7_01.<<RunWithSolutionAsync>g__ProcessSolutionAsync|1>d.MoveNext() --- End of stack trace from previous location --- at Microsoft.CodeAnalysis.Remote.RemoteWorkspace.RunWithSolutionAsync[T](AssetProvider assetProvider, Checksum solutionChecksum, Boolean updatePrimaryBranch, Func2 implementation, CancellationToken cancellationToken)
at Microsoft.CodeAnalysis.Remote.RemoteWorkspace.RunWithSolutionAsync[T](AssetProvider assetProvider, Checksum solutionChecksum, Boolean updatePrimaryBranch, Func2 implementation, CancellationToken cancellationToken) at Microsoft.CodeAnalysis.Remote.RemoteWorkspaceManager.RunServiceAsync[T](ServiceBrokerClient client, Checksum solutionChecksum, Func2 implementation, CancellationToken cancellationToken)

Razor DataTipRange Featuer is currently unavailable due to an internal error:

StreamJsonRpc.RemoteInvocationException: (30,63) matches or exceeds SourceText boundary 418.
at StreamJsonRpc.JsonRpc.d__1711.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.Threading.Tasks.ValueTask1.get_Result()
at Microsoft.CodeAnalysis.Remote.BrokeredServiceConnection1.<TryInvokeAsync>d__181.MoveNext()
RPC server exception:
System.InvalidOperationException: (30,63) matches or exceeds SourceText boundary 418.
at Microsoft.AspNetCore.Razor.ThrowHelper.ThrowInvalidOperationException[T](String message)
at Microsoft.CodeAnalysis.Text.SourceTextExtensions.GetRequiredAbsoluteIndex(SourceText text, Int32 line, Int32 character)
at Roslyn.LanguageServer.Protocol.LspExtensions.GetRequiredAbsoluteIndex(SourceText text, Position position)
at Microsoft.CodeAnalysis.Remote.Razor.RemoteDataTipRangeService.GetDataTipRangeAsync(RemoteDocumentContext context, Position position, CancellationToken cancellationToken)
at Microsoft.CodeAnalysis.Remote.RemoteWorkspace.<>c__DisplayClass7_01.<<RunWithSolutionAsync>g__ProcessSolutionAsync|1>d.MoveNext() --- End of stack trace from previous location --- at Microsoft.CodeAnalysis.Remote.RemoteWorkspace.RunWithSolutionAsync[T](AssetProvider assetProvider, Checksum solutionChecksum, Boolean updatePrimaryBranch, Func2 implementation, CancellationToken cancellationToken)
at Microsoft.CodeAnalysis.Remote.RemoteWorkspace.RunWithSolutionAsync[T](AssetProvider assetProvider, Checksum solutionChecksum, Boolean updatePrimaryBranch, Func2 implementation, CancellationToken cancellationToken) at Microsoft.CodeAnalysis.Remote.RemoteWorkspaceManager.RunServiceAsync[T](ServiceBrokerClient client, Checksum solutionChecksum, Func2 implementation, CancellationToken cancellationToken)

Components aren’t rendering:

Navigating to sub properties in the Radzen properties cause crashes, ie - clicking RadzenStack here caused a Visual Studio hard crash:

image

ActivityLog.zip (23.2 KB)

I’ve attached the ActivityLog from Visual Studio which might help identifying issues. If I can be pointed to a log location for the Radzen extension I can pass that on as well

Hi @LostLogic,

You seem to be reporting three different issues. Is this correct?

The Razor SemanticTokens feature isn't implemented by the Radzen VS extension and the Activity Log you have attached doesn't include any Radzen related messages. (the same as the stacktrace). If you believe our extension is causing this issue please provide reproduction steps.

What is the CustomerList component? For now it seems some component is making database access in its lifecycle methods. You can use preprocessor directives to hide this code from design time builds.

Also clicking parent components doesn't seem to crash in local tests. Does it happen always in your app?

All these errors occur while the Radzen Extension is enabled. If I disable it or use a different solution - ie Avalonia that allow for visual UI editing in Visual Studio these errors do not occur. I’ve seen them crop up as I work in the XAML / Code blocks. I suspect the visualizer doesn’t wait until the code is valid and continually tries to render the page regardless of the XAML / C# validity - causing the internal methods of VS to exception out as it’s in an invalid build state while tags are not closed, debug constants aren’t completed etc.

In terms of preprocessor directives - afaik the Radzen visualizer should not call application lifecycle methods? I can guard them if the compiler constant if that’s not the case. Worth noting is that the visual error above does not occur in the Radzen Studio.

The hard crash most frequently occurs if I’m running the project in Debug mode and edit the UI while the application is running. But I have experienced while not running the application as well. It’s made me rather paranoid about saving the page I’m working on - and isn’t viable in the long run. Visual Studio has been unable to recover the lost data following the crashes which sucks.

The Radzen design time rendering doesn't affect the Razor syntax service in any way. It happens in a separate process from Visual Studio. Again if you believe this razor syntax error is caused by our plugin feel free to provide reproduction steps.

Currently life-cycle methods are overridden only for the current page. Other components may not have their life-cycle methods overridden in order to preserve some of their behavior and provide adequate preview.

We have found one cause of this problem and will address it in a future release.

Thanks korchev.

I’ve reported the other issues to Microsoft. Hopefully they’ll patch the errors as they are likely an issue in Visual Studio - not in Radzen.

Btw, Source Formatting Ctrl-K Ctrl-D does not seem to work when the Radzen extension is enabled. Disabling the extension and running the source formatting worked fine. I ought to report it in a separate new thread, but I’ll sneak it in here

Just tested that and it seems to work. Here is a screen recording of my experience.
format-document

I’ll try it and report back again.

Note - I disabled the Radzen extension. Went into Extension to Enable it. Restarted Visual Studio. Following the next startup of Visual Studio, Radzen shows as Installed and Enabled - but it’s not showing in the menus. The design view does not appear when I select a razor page.

I’ve experienced this before, and it’s resolved by uninstalling, then installing it. But it might be worth looking into.

I’ll do that now and report back if the source formatting issue was a blip or if it’s still an issue on my dev environment.

Attached is my experience when I try to format the source:

Recording 2026-03-12 104311.zip (3.0 MB)

You can also see the Razor CodeActions Feature throwing when I mark the markup and shift+tab it down.

Code formatting does not work, even if I close and open the razor page and do the formatting before the issue with CodeActions occurs.

As noted earlier, this is likely an MS issue.

StreamJsonRpc.RemoteInvocationException: (16,23) matches or exceeds SourceText boundary 191.
at StreamJsonRpc.JsonRpc.d__1711.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.Threading.Tasks.ValueTask1.get_Result()
at Microsoft.CodeAnalysis.Remote.BrokeredServiceConnection1.<TryInvokeAsync>d__181.MoveNext()
RPC server exception:
System.InvalidOperationException: (16,23) matches or exceeds SourceText boundary 191.
at Microsoft.AspNetCore.Razor.ThrowHelper.ThrowInvalidOperationException[T](String message)
at Microsoft.CodeAnalysis.Text.SourceTextExtensions.GetRequiredAbsoluteIndex(SourceText text, Int32 line, Int32 character)
at Roslyn.LanguageServer.Protocol.LspExtensions.GetRequiredAbsoluteIndex(SourceText text, Position position)
at Microsoft.CodeAnalysis.Remote.Razor.RemoteCodeActionsService.GetCodeActionRequestInfoAsync(RemoteDocumentContext context, VSCodeActionParams request, CancellationToken cancellationToken)
at Microsoft.CodeAnalysis.Remote.RemoteWorkspace.<>c__DisplayClass7_01.<<RunWithSolutionAsync>g__ProcessSolutionAsync|1>d.MoveNext() --- End of stack trace from previous location --- at Microsoft.CodeAnalysis.Remote.RemoteWorkspace.RunWithSolutionAsync[T](AssetProvider assetProvider, Checksum solutionChecksum, Boolean updatePrimaryBranch, Func2 implementation, CancellationToken cancellationToken)
at Microsoft.CodeAnalysis.Remote.RemoteWorkspace.RunWithSolutionAsync[T](AssetProvider assetProvider, Checksum solutionChecksum, Boolean updatePrimaryBranch, Func2 implementation, CancellationToken cancellationToken) at Microsoft.CodeAnalysis.Remote.RemoteWorkspaceManager.RunServiceAsync[T](ServiceBrokerClient client, Checksum solutionChecksum, Func2 implementation, CancellationToken cancellationToken)

I can echo the same experience as the OP. For about a month now, it’ll work for 10-15mins, if that, and then I get errors at the top of VS26 as they report, and ctrl+k+d stops working, Radzen tags are no longer resolved with intellisense properties, etc. Closing VS and going back in resolves the issue for a brief period before it occurs again.

I created a brand new dev PC build with fresh Win 11, VS26, Radzen for VS in latest versions and this issue occurs immediately in the fresh build. I can also echo that it only does this when in projects utilizing Radzen for VS. If I create plain blazor project or any other VS project type, no errors occur.

The Radzen VS plugin should be enabled in all Blazor projects.

Can you provide some instructions how to reproduce the issue? We still cannot reproduce it.

UPDATE: Do you remember if you have used the Property Grid before this error started to happen? I have a theory but cannot reproduce it yet.

I still cannot reproduce the problem after a few attempts and long sessions. However I found these issues that seem related:

Hi korchev -

I am not exactly sure what causes it. It does seem to happen when working in a .razor file and from what I can tell, happens when I add or change a control/component element. I’m attaching a screenshot of one of the errors I get and the text of the error. Again, closing VS and reopening makes it “happy” again for a bit.

TEXT: StreamJsonRpc.RemoteInvocationException: (27,34) matches or exceeds SourceText boundary 46.
at StreamJsonRpc.JsonRpc.d__1711.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.Threading.Tasks.ValueTask1.get_Result()
at Microsoft.CodeAnalysis.Remote.BrokeredServiceConnection1.<TryInvokeAsync>d__181.MoveNext()
RPC server exception:
System.InvalidOperationException: (27,34) matches or exceeds SourceText boundary 46.
at Microsoft.AspNetCore.Razor.ThrowHelper.ThrowInvalidOperationException[T](String message)
at Microsoft.CodeAnalysis.Text.SourceTextExtensions.GetRequiredAbsoluteIndex(SourceText text, Int32 line, Int32 character)
at Roslyn.LanguageServer.Protocol.LspExtensions.GetRequiredAbsoluteIndex(SourceText text, Position position)
at Microsoft.CodeAnalysis.Remote.Razor.RemoteCodeActionsService.GetCodeActionRequestInfoAsync(RemoteDocumentContext context, VSCodeActionParams request, CancellationToken cancellationToken)
at Microsoft.CodeAnalysis.Remote.RemoteWorkspace.<>c__DisplayClass7_01.<<RunWithSolutionAsync>g__ProcessSolutionAsync|1>d.MoveNext() --- End of stack trace from previous location --- at Microsoft.CodeAnalysis.Remote.RemoteWorkspace.RunWithSolutionAsync[T](AssetProvider assetProvider, Checksum solutionChecksum, Boolean updatePrimaryBranch, Func2 implementation, CancellationToken cancellationToken)
at Microsoft.CodeAnalysis.Remote.RemoteWorkspace.RunWithSolutionAsync[T](AssetProvider assetProvider, Checksum solutionChecksum, Boolean updatePrimaryBranch, Func2 implementation, CancellationToken cancellationToken) at

Microsoft.CodeAnalysis.Remote.RemoteWorkspaceManager.RunServiceAsync[T](ServiceBrokerClient client, Checksum solutionChecksum, Func2 implementation, CancellationToken cancellationToken)

Unfortunately this doesn't bring any new information - as you see there is no Radzen code in the stacktrace. Not sure what is causing the problem either but the linked issues demonstrate people that experience the same thing without Radzen.

Understood. Thank you for looking! We really appreciate how responsive and helpful you are, Atanas!

Please let me know (or anybody having the same problem) if you manage to find a predictable reproduction. We realise this is a real issue and would like to solve it if our product is somehow triggering it.