Skip to content

error on automatic format for .cshtml file #9358

@NEOSDEVNIC

Description

@NEOSDEVNIC

Type: Bug

Issue Description

Save changes in a .cshtml

Steps to Reproduce

modify a cshtml file with copilot

Expected Behavior

save with out fails

Actual Behavior

save changes but notify than automatic format fails

Extension version: 2.140.8
VS Code version: Code - Insiders 1.122.0-insider (6bb5e61adc5714fd0313615ea510be49b5fdd5f1, 2026-05-28T14:33:59+10:00)
OS version: Windows_NT x64 10.0.26200
Modes:

Logs

C# log

Details
2026-05-28 06:00:16.275 [info] Locating .NET runtime version 10.0.5
2026-05-28 06:00:16.865 [info] Dotnet path: C:\Program Files\dotnet\dotnet.exe
2026-05-28 06:00:16.865 [info] Activating C# + C# Dev Kit...
2026-05-28 06:00:17.668 [info] info: Program[0]
2026-05-28 06:00:17.668 [info]       Server started with process ID 13556
2026-05-28 06:00:19.422 [info] [Program] Language server initialized
2026-05-28 06:00:19.425 [info] [Program] Monitoring client process 14508 for exit
2026-05-28 06:00:19.954 [info] [initialized] [Microsoft.CodeAnalysis.LanguageServer.FileBasedPrograms.FileBasedProgramsEntryPointDiscovery] Finished discovery in 'd:\peopleapps\SISRUAP_FE\SRP.UI' in 15 milliseconds
2026-05-28 06:00:21.702 [info] [textDocument/_vs_getProjectContexts] [Microsoft.CodeAnalysis.MSBuild.BuildHostProcessManager] .NET BuildHost started from c:\Users\Jose L Moreno\.vscode-insiders\extensions\ms-dotnettools.csharp-2.140.8-win32-x64\.roslyn\Microsoft.CodeAnalysis.LanguageServer.exe reloading to start from C:\Program Files\dotnet\dotnet.exe to match necessary SDK location.
2026-05-28 06:00:23.865 [warning] [textDocument/_vs_getProjectContexts] [LanguageServerProjectLoader] Project C:\Users\Jose L Moreno\AppData\Local\Temp\roslyn-canonical-misc\7b969449-4f6c-4228-a793-d0b5aa41890c\Canonical.csproj has unresolved dependencies
2026-05-28 06:00:25.391 [info] [serviceBroker/connect] [WorkspaceProjectFactoryService] Project D:\peopleapps\SISRUAP_FE\SRP.UI\SRP.UI.csproj loaded by C# Dev Kit
2026-05-28 06:00:31.617 [info] [textDocument/_vs_getProjectContexts] [LanguageServerProjectLoader] Successfully completed load of d:\peopleapps\SISRUAP_FE\SRP.UI\Controllers\FOMUJERES\EmpoderamientoController.cs
2026-05-28 06:00:31.633 [info] [textDocument/_vs_getProjectContexts] [LanguageServerProjectLoader] Restoring Canonical.csproj: Running dotnet restore on C:\Users\Jose L Moreno\AppData\Local\Temp\roslyn-canonical-misc\7b969449-4f6c-4228-a793-d0b5aa41890c\Canonical.csproj
2026-05-28 06:00:31.634 [info] [textDocument/_vs_getProjectContexts] [Microsoft.CodeAnalysis.LanguageServer.DotnetCliHelper] Using dotnet executable configured on the PATH
2026-05-28 06:00:32.636 [info] [textDocument/_vs_getProjectContexts] [LanguageServerProjectLoader] Restoring Canonical.csproj:   Determining projects to restore...
2026-05-28 06:00:32.991 [info] [textDocument/_vs_getProjectContexts] [LanguageServerProjectLoader] Restoring Canonical.csproj:   Restored C:\Users\Jose L Moreno\AppData\Local\Temp\roslyn-canonical-misc\7b969449-4f6c-4228-a793-d0b5aa41890c\Canonical.csproj (in 89 ms).
2026-05-28 06:00:33.058 [info] [textDocument/_vs_getProjectContexts] [LanguageServerProjectLoader] Restore complete
2026-05-28 06:00:33.058 [info] [textDocument/_vs_getProjectContexts] [LanguageServerProjectLoader] Completed (re)load of all projects in 00:00:12.5740264
2026-05-28 06:00:46.914 [info] [workspace/didChangeWatchedFiles] [LanguageServerProjectLoader] Completed (re)load of all projects in 00:00:00.0012539
2026-05-28 06:52:44.712 [error] Request textDocument/formatting failed.
  Message: 'end' must not be less than 'start'. start='6933' end='6908'. (Parameter 'end')
  Code: -32000 
[object Object]
2026-05-28 06:59:04.527 [error] Request textDocument/formatting failed.
  Message: 'end' must not be less than 'start'. start='6933' end='6908'. (Parameter 'end')
  Code: -32000 
[object Object]
2026-05-28 06:59:20.579 [error] Request textDocument/formatting failed.
  Message: 'end' must not be less than 'start'. start='6933' end='6908'. (Parameter 'end')
  Code: -32000 
[object Object]
2026-05-28 06:59:34.093 [error] Request textDocument/formatting failed.
  Message: 'end' must not be less than 'start'. start='6933' end='6908'. (Parameter 'end')
  Code: -32000 
[object Object]

C# LSP Trace Logs log

Details

Environment Information

VSCode version: 1.122.0-insider
C# Extension: 2.140.8
Using OmniSharp: false

Dotnet Information .NET SDK: Version: 10.0.300 Commit: caa81fa497 Workload version: 10.0.300-manifests.e0989437 MSBuild version: 18.6.3+caa81fa49

Runtime Environment:
OS Name: Windows
OS Version: 10.0.26200
OS Platform: Windows
RID: win-x64
Base Path: C:\Program Files\dotnet\sdk\10.0.300\

.NET workloads installed:
[wasm-tools]
Installation Source: VS 17.14.37314.3, VS 18.7.11819.209
Manifest Version: 10.0.108/10.0.100
Manifest Path: C:\Program Files\dotnet\sdk-manifests\10.0.100\microsoft.net.workload.mono.toolchain.current\10.0.108\WorkloadManifest.json
Install Type: Msi

Configured to use workload sets when installing new manifests.
No workload sets are installed. Run "dotnet workload restore" to install a workload set.

Host:
Version: 10.0.8
Architecture: x64
Commit: 94ea82652c

.NET SDKs installed:
6.0.428 [C:\Program Files\dotnet\sdk]
9.0.100-rc.2.24474.11 [C:\Program Files\dotnet\sdk]
9.0.200 [C:\Program Files\dotnet\sdk]
9.0.314 [C:\Program Files\dotnet\sdk]
10.0.300 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
Microsoft.AspNetCore.App 3.1.32 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 6.0.36 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 7.0.20 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 8.0.27 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 9.0.0-rc.2.24474.3 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 9.0.2 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 9.0.16 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 10.0.8 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 3.1.32 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 6.0.36 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 7.0.20 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 8.0.27 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 9.0.0-rc.2.24473.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 9.0.2 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 9.0.16 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 10.0.8 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 3.1.32 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 6.0.36 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 7.0.20 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 8.0.27 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 9.0.0-rc.2.24474.4 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 9.0.2 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 9.0.16 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 10.0.8 [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:
DOTNET_CLI_UI_LANGUAGE [en-US]

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
azurite Azurite 3.35.0 azurite.azurite-3.35.0
better-comments aaron-bond 3.0.2 aaron-bond.better-comments-3.0.2
continue Continue 1.3.38 continue.continue-1.3.38-win32-x64
csdevkit ms-dotnettools 3.20.199 ms-dotnettools.csdevkit-3.20.199-win32-x64
csharp ms-dotnettools 2.140.8 ms-dotnettools.csharp-2.140.8-win32-x64
data-workspace-vscode ms-mssql 0.6.3 ms-mssql.data-workspace-vscode-0.6.3
debugpy ms-python 2026.7.11471010 ms-python.debugpy-2026.7.11471010-win32-x64
docstring Docstring 0.6.3 docstring.docstring-0.6.3
jupyter ms-toolsai 2025.9.1 ms-toolsai.jupyter-2025.9.1-win32-x64
jupyter-keymap ms-toolsai 1.1.2 ms-toolsai.jupyter-keymap-1.1.2
jupyter-renderers ms-toolsai 1.3.2025062701 ms-toolsai.jupyter-renderers-1.3.2025062701
MagicPython magicstack 1.1.0 magicstack.magicpython-1.1.0
material-icon-theme PKief 5.35.0 pkief.material-icon-theme-5.35.0
mingit muhammadmohsen 0.12.4 muhammadmohsen.mingit-0.12.4
monotainer monosyde 0.1.4 monosyde.monotainer-0.1.4
mssql ms-mssql 1.42.2 ms-mssql.mssql-1.42.2
ng-template Angular 21.2.4 angular.ng-template-21.2.4
notepadplusplus-keybindings ms-vscode 1.0.7 ms-vscode.notepadplusplus-keybindings-1.0.7
python ms-python 2026.5.2026052501 ms-python.python-2026.5.2026052501-win32-x64
remote-containers ms-vscode-remote 0.460.0 ms-vscode-remote.remote-containers-0.460.0
sql-bindings-vscode ms-mssql 0.4.1 ms-mssql.sql-bindings-vscode-0.4.1
sql-database-projects-vscode ms-mssql 1.5.9 ms-mssql.sql-database-projects-vscode-1.5.9
vscode-azureappservice ms-azuretools 0.26.5 ms-azuretools.vscode-azureappservice-0.26.5
vscode-azureresourcegroups ms-azuretools 0.12.4 ms-azuretools.vscode-azureresourcegroups-0.12.4
vscode-containers ms-azuretools 2.4.4 ms-azuretools.vscode-containers-2.4.4
vscode-database-client2 cweijan 8.4.7 cweijan.vscode-database-client2-8.4.7
vscode-docker-registry-explorer TqrHsn 0.1.3 tqrhsn.vscode-docker-registry-explorer-0.1.3
vscode-dotnet-runtime ms-dotnettools 3.0.2 ms-dotnettools.vscode-dotnet-runtime-3.0.2
vscode-jupyter-cell-tags ms-toolsai 0.1.9 ms-toolsai.vscode-jupyter-cell-tags-0.1.9
vscode-jupyter-powertoys ms-toolsai 0.1.1 ms-toolsai.vscode-jupyter-powertoys-0.1.1
vscode-jupyter-slideshow ms-toolsai 0.1.6 ms-toolsai.vscode-jupyter-slideshow-0.1.6
vscode-pylance ms-python 2026.2.103 ms-python.vscode-pylance-2026.2.103
vscode-python-envs ms-python 1.33.2026052801 ms-python.vscode-python-envs-1.33.2026052801-win32-x64
vscode-python-typehint njqdev 1.5.1 njqdev.vscode-python-typehint-1.5.1
C# Settings
Setting Value
preferCSharpExtension false
compilerDiagnosticScope openFiles
analyzerDiagnosticScope openFiles
enableXamlTools true
useServerGC true
System Info
Item Value
CPUs 12th Gen Intel(R) Core(TM) i5-12500H (16 x 3110)
GPU Status 2d_canvas: enabled
GPU0: VENDOR= 0x8086, DEVICE=0x46a6 [Intel(R) Iris(R) Xe Graphics], DRIVER_VENDOR=Intel, DRIVER_VERSION=30.0.101.1660 ACTIVE
GPU1: VENDOR= 0x8086, DEVICE=0x46a6 [Intel(R) Iris(R) Xe Graphics], DRIVER_VERSION=30.0.101.1660
GPU2: VENDOR= 0x8086, DEVICE=0x46a6 [Intel(R) Iris(R) Xe Graphics], DRIVER_VERSION=30.0.101.1660
GPU3: VENDOR= 0x1414, DEVICE=0x008c [Microsoft Basic Render Driver], DRIVER_VERSION=10.0.26100.8328
Machine model name:
Machine model version:
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
trees_in_viz: disabled_off
video_decode: enabled
video_encode: enabled
webgl: enabled
webgpu: enabled
webnn: disabled_off
Load (avg) undefined
Memory (System) 23.69GB (12.03GB free)
Process Argv --crash-reporter-id 982e7db6-d247-44ff-a7bf-4067606b0c83
Screen Reader no
VM 0%
A/B Experiments
vsliv368:30146709
pythonvspyt551cf:31249598
nativeloc1:31118317
dwcopilot:31158714
dwoutputs:31242946
copilot_t_ci:31333650
g012b348:31231168
pythonrdcb7:31268811
pythonpcpt1cf:31399617
6518g693:31302842
6abeh943:31336334
envsactivate1:31349248
editstats-enabled:31346256
cloudbuttont:31366566
3efgi100_wstrepl:31403338
839jf696:31457053
cp_cls_t_966_ss:31454198
inlinechat_v2_hd992725:31445440
4je02754:31455664
8hhj4413:31478653
38bie571_auto:31426784
cp_cls_t_1081:31454832
conptydll_true:31485575
ia-use-proxy-models-svc:31446143
e9c30283:31453065
test_treatment2:31471001
46204921:31447328
idci7584:31454084
nes_chat_context_enabled:31451401
e3e4d672:31454087
ei9d7968:31462942
de16b994:31458079
89g7j272:31506658
7e884298:31462391
7e187181:31482583
i2gc6536:31472020
52612955:31508042
h08i8180:31475367
23c7c724:31520045
ddid_t:31478204
hmra_i5g22:31518061
getcmakediagnosticsoff:31489825
f_rl1_7dj4g856:31519684
bjc72774_agent_sandbox:31505880
7df3h592:31491241
cp_cls_t_1082:31516087
logging_enabled_new:31490725
nes-extended-cfe-ctrl:31520692
jb_cp_cls_c_632:31517842
cg448276_tst_on:31503513
32d76977:31503652
ha629193:31508444
31fi7170_t:31517328
a1ije391_t:31520709
05755904:31517511
45j1j371_treat:31518485

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions