vscode-csharp
vscode-csharp copied to clipboard
The Razor Language Server crashed 5 times in the last 3 minutes.
Type: Bug
Issue Description
Steps to Reproduce
Copilot was updating a razor file to use an API it had just written when this error appeared on the screen.
"The Razor Language Server crashed 5 times in the last 3 minutes. The server will not be restarted."
Expected Behavior
Razor Language Server does not crash.
Actual Behavior
Razor Language Server crashed and would not restart.
Logs
C# log
C# LSP Trace Logs
"2025-05-02 09:59:43.865 [info] Process terminated. Assertion failed. Fault Event: dotnet/razor/fault Exception Info: System.InvalidOperationException: End: (54,8) matches or exceeds SourceText boundary 53. at Microsoft.AspNetCore.Razor.ThrowHelper.ThrowInvalidOperationException[T](String message) in S:\razor\src\Shared\Microsoft.AspNetCore.Razor.Utilities.Shared\ThrowHelper.cs:line 234 at Microsoft.CodeAnalysis.Text.SourceTextExtensions.<GetTextSpan>g__GetAbsoluteIndex|25_0(SourceText text, Int32 line, Int32 character, String name) in S:\razor\src\Razor\src\Microsoft.CodeAnalysis.Razor.Workspaces\Extensions\SourceTextExtensions.cs:line 264 at Microsoft.CodeAnalysis.Text.SourceTextExtensions.GetTextSpan(SourceText text, Int32 startLine, Int32 startCharacter, Int32 endLine, Int32 endCharacter) in S:\razor\src\Razor\src\Microsoft.CodeAnalysis.Razor.Workspaces\Extensions\SourceTextExtensions.cs:line 252 at Microsoft.CodeAnalysis.Text.SourceTextExtensions.GetTextSpan(SourceText text, LinePosition start, LinePosition end) in S:\razor\src\Razor\src\Microsoft.CodeAnalysis.Razor.Workspaces\Extensions\SourceTextExtensions.cs:line 244 at Microsoft.CodeAnalysis.Text.SourceTextExtensions.GetTextSpan(SourceText text, LinePositionSpan span) in S:\razor\src\Razor\src\Microsoft.CodeAnalysis.Razor.Workspaces\Extensions\SourceTextExtensions.cs:line 247 at Microsoft.CodeAnalysis.Razor.SemanticTokens.AbstractRazorSemanticTokensInfoService.GetSemanticTokensAsync(DocumentContext documentContext, LinePositionSpan span, Guid correlationId, Boolean colorBackground, CancellationToken cancellationToken) in S:\razor\src\Razor\src\Microsoft.CodeAnalysis.Razor.Workspaces\SemanticTokens\AbstractRazorSemanticTokensInfoService.cs:line 71 at Microsoft.CodeAnalysis.Razor.SemanticTokens.AbstractRazorSemanticTokensInfoService.GetSemanticTokensAsync(DocumentContext documentContext, LinePositionSpan span, Boolean colorBackground, Guid correlationId, CancellationToken cancellationToken) in S:\razor\src\Razor\src\Microsoft.CodeAnalysis.Razor.Workspaces\SemanticTokens\AbstractRazorSemanticTokensInfoService.cs:line 45 at Microsoft.AspNetCore.Razor.LanguageServer.Semantic.SemanticTokensRangeEndpoint.HandleRequestAsync(SemanticTokensRangeParams request, RazorRequestContext requestContext, CancellationToken cancellationToken) in S:\razor\src\Razor\src\Microsoft.AspNetCore.Razor.LanguageServer\Semantic\SemanticTokensRangeEndpoint.cs:line 53 "
Environment information
VSCode version: 1.100.0-insider C# Extension: 2.75.9 Using OmniSharp: false
Dotnet Information
.NET SDK: Version: 9.0.300-preview.0.25177.5 Commit: 3d5b396331 Workload version: 9.0.300-manifests.78a0f7ac MSBuild version: 17.14.0-preview-25175-08+5880e1c75Runtime Environment: OS Name: Windows OS Version: 10.0.26120 OS Platform: Windows RID: win-x64 Base Path: C:\Program Files\dotnet\sdk\9.0.300-preview.0.25177.5\
.NET workloads installed: [aspire] Installation Source: VS 17.14.36025.13 Manifest Version: 8.2.2/8.0.100 Manifest Path: C:\Program Files\dotnet\sdk-manifests\8.0.100\microsoft.net.sdk.aspire\8.2.2\WorkloadManifest.json Install Type: Msi
[maccatalyst] Installation Source: VS 17.14.36025.13 Manifest Version: 18.4.9288/9.0.100 Manifest Path: C:\Program Files\dotnet\sdk-manifests\9.0.100\microsoft.net.sdk.maccatalyst\18.4.9288\WorkloadManifest.json Install Type: Msi
[maui-windows] Installation Source: VS 17.14.36025.13 Manifest Version: 9.0.51/9.0.100 Manifest Path: C:\Program Files\dotnet\sdk-manifests\9.0.100\microsoft.net.sdk.maui\9.0.51\WorkloadManifest.json Install Type: Msi
[android] Installation Source: VS 17.14.36025.13 Manifest Version: 35.0.61/9.0.100 Manifest Path: C:\Program Files\dotnet\sdk-manifests\9.0.100\microsoft.net.sdk.android\35.0.61\WorkloadManifest.json Install Type: Msi
[ios] Installation Source: VS 17.14.36025.13 Manifest Version: 18.4.9288/9.0.100 Manifest Path: C:\Program Files\dotnet\sdk-manifests\9.0.100\microsoft.net.sdk.ios\18.4.9288\WorkloadManifest.json Install Type: Msi
Configured to use loose manifests when installing new manifests.
Host: Version: 9.0.4 Architecture: x64 Commit: f57e6dc747
.NET SDKs installed: 7.0.410 [C:\Program Files\dotnet\sdk] 8.0.311 [C:\Program Files\dotnet\sdk] 8.0.408 [C:\Program Files\dotnet\sdk] 9.0.105 [C:\Program Files\dotnet\sdk] 9.0.203 [C:\Program Files\dotnet\sdk] 9.0.300-preview.0.25177.5 [C:\Program Files\dotnet\sdk]
.NET runtimes installed: Microsoft.AspNetCore.App 7.0.20 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 8.0.14 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 8.0.15 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 9.0.3 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 9.0.4 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.NETCore.App 7.0.20 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 8.0.14 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 8.0.15 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 9.0.3 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 9.0.4 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.WindowsDesktop.App 7.0.20 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 8.0.14 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 8.0.15 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 9.0.3 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 9.0.4 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Other architectures found: x86 [C:\Program Files (x86)\dotnet] registered at [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\x86\InstallLocation]
Environment variables: Not set
global.json file: Not found
Learn more: https://aka.ms/dotnet/info
Download .NET: https://aka.ms/dotnet/download
Visual Studio Code Extensions
| Extension | Author | Version | Folder Name |
|---|---|---|---|
| azure-dev | ms-azuretools | 0.9.0 | ms-azuretools.azure-dev-0.9.0 |
| copilot | GitHub | 1.311.1540 | github.copilot-1.311.1540 |
| copilot-chat | GitHub | 0.27.2025050202 | github.copilot-chat-0.27.2025050202 |
| csdevkit | ms-dotnettools | 1.19.45 | ms-dotnettools.csdevkit-1.19.45-win32-x64 |
| csharp | ms-dotnettools | 2.75.9 | ms-dotnettools.csharp-2.75.9 |
| gitlens | eamodio | 2025.5.205 | eamodio.gitlens-2025.5.205 |
| msbuild-editor | mhutch | 2.9.676-g4bd136a1f0 | mhutch.msbuild-editor-2.9.676-g4bd136a1f0 |
| remote-containers | ms-vscode-remote | 0.412.0 | ms-vscode-remote.remote-containers-0.412.0 |
| vscode-ai-foundry | TeamsDevApp | 0.3.2 | teamsdevapp.vscode-ai-foundry-0.3.2 |
| vscode-azure-github-copilot | ms-azuretools | 0.3.252 | ms-azuretools.vscode-azure-github-copilot-0.3.252-win32-x64 |
| vscode-azureresourcegroups | ms-azuretools | 0.10.10 | ms-azuretools.vscode-azureresourcegroups-0.10.10 |
| vscode-dotnet-runtime | ms-dotnettools | 2.3.3 | ms-dotnettools.vscode-dotnet-runtime-2.3.3 |
| vscode-learncloud | azurepaas-tools | 0.8.0 | azurepaas-tools.vscode-learncloud-0.8.0 |
| vscode-yaml | redhat | 1.18.0 | redhat.vscode-yaml-1.18.0 |
| windows-ai-studio | ms-windows-ai-studio | 0.12.1 | ms-windows-ai-studio.windows-ai-studio-0.12.1-win32-x64 |
Extension version: 2.75.9 VS Code version: Code - Insiders 1.100.0-insider (47ea00afe6b2b1cb01492d7e7d466989f5727894, 2025-05-02T05:04:33.911Z) OS version: Windows_NT x64 10.0.26120 Modes:
System Info
| Item | Value |
|---|---|
| CPUs | Intel(R) Core(TM) Ultra 7 165H (22 x 3072) |
| 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) | 15.64GB (0.69GB free) |
| Process Argv | --crash-reporter-id df9569b1-4056-47ee-b1a6-521ad1c587e3 |
| Screen Reader | no |
| VM | 0% |
A/B Experiments
vsliv368cf:30146710
vspor879:30202332
vspor708:30202333
vspor363:30204092
pythonvspyt551cf:31249598
vscod805:30301674
c4g48928:30535728
962ge761:30841072
dsvsc014:30777825
dsvsc015:30821418
h48ei257:31000450
pythontbext0:30879054
cppperfnew:30980852
dwnewjupytercf:31046870
pythonrstrctxt:31093868
nativeloc1:31118317
e80f6927:31120813
dwcopilot:31158714
c3hdf307:31184662
6074i472:31201624
dwoutputs:31242946
customenabled:31248079
hdaa2157:31222309
copilot_t_ci:31222730
g012b348:31231168
pythoneinst12:31251391
bgtreat:31252123
c7cif404:31294349
31787653:31262186
3e8i5726:31271747
pythonpulldiag:31287486
6gi0g917:31259950
editoredits36407:31282444
996jf627:31264550
pythonrdcb7:31268811
usemplatestapi:31297334
i53e4855:31297587
747dc170:31275146
pythonfullctx:31296836
aj496949:31278748
9hi5e907:31296557
pylancecolor:31288664
generatesymbolt:31280541
convertfstringf:31280702
gendocf:31280703
pylancequickfixf:31296867