No Quick Action to remove unused field - Razor
- Dominant language
- C#
- Stars
- 20.7k
- Forks
- 4.3k
- PR merge metrics
- PR metrics pending
Description
Type: Bug
## Issue Description ##
## Steps to Reproduce ##
I'm editing a razor file that contains a field that is never used. It provides me with the warning that it is never used, but when I click on Quick Fixes, there are none.

## Expected Behavior ##
Provide "Remove unused field" as a quick fix.
## Actual Behavior ##
Only provies asking Copilot for help.
## Logs ##
### C# log ###
Post the output from Output-->C# here
### C# LSP Trace Logs ###
Post the output from Output-->C# LSP Trace Logs here. Requires the `C#` output window log level to be set to `Trace`
## Environment information ##
**VSCode version**: 1.101.0-insider
**C# Extension**: 2.81.17
**Using OmniSharp**: false
Dotnet Information
.NET SDK:
Version: 9.0.300
Commit: 15606fe0a8
Workload version: 9.0.300-manifests.87b8cca8
MSBuild version: 17.14.5+edd3bbf37
Runtime 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\
.NET workloads installed:
[aspire]
Installation Source: VS 17.14.36121.58
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.36121.58
Manifest Version: 18.4.9289/9.0.100
Manifest Path: C:\Program Files\dotnet\sdk-manifests\9.0.100\microsoft.net.sdk.maccatalyst\18.4.9289\WorkloadManifest.json
Install Type: Msi
[maui-windows]
Installation Source: VS 17.14.36121.58
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.36121.58
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.36121.58
Manifest Version: 18.4.9289/9.0.100
Manifest Path: C:\Program Files\dotnet\sdk-manifests\9.0.100\microsoft.net.sdk.ios\18.4.9289\WorkloadManifest.json
Install Type: Msi
Configured to use loose manifests when installing new manifests.
Host:
Version: 9.0.5
Architecture: x64
Commit: e36e4d1a8f
.NET SDKs installed:
7.0.410 [C:\Program Files\dotnet\sdk]
8.0.312 [C:\Program Files\dotnet\sdk]
8.0.409 [C:\Program Files\dotnet\sdk]
9.0.106 [C:\Program Files\dotnet\sdk]
9.0.204 [C:\Program Files\dotnet\sdk]
9.0.300 [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.16 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 9.0.5 [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.16 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 9.0.5 [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.16 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 9.0.5 [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.328.1603|github.copilot-1.328.1603|
|copilot-chat|GitHub|0.28.2025060401|github.copilot-chat-0.28.2025060401|
|csdevkit|ms-dotnettools|1.30.4|ms-dotnettools.csdevkit-1.30.4-win32-x64|
|csharp|ms-dotnettools|2.81.17|ms-dotnettools.csharp-2.81.17-win32-x64|
|dotnet-maui|ms-dotnettools|1.10.16|ms-dotnettools.dotnet-maui-1.10.16-win32-x64|
|gitlens|eamodio|2025.6.405|eamodio.gitlens-2025.6.405|
|msbuild-editor|mhutch|2.9.676-g4bd136a1f0|mhutch.msbuild-editor-2.9.676-g4bd136a1f0|
|remote-containers|ms-vscode-remote|0.415.0|ms-vscode-remote.remote-containers-0.415.0|
|test-adapter-converter|ms-vscode|0.2.1|ms-vscode.test-adapter-converter-0.2.1|
|vscode-ai-foundry|TeamsDevApp|0.6.0|teamsdevapp.vscode-ai-foundry-0.6.0|
|vscode-azure-github-copilot|ms-azuretools|1.0.8|ms-azuretools.vscode-azure-github-copilot-1.0.8-win32-x64|
|vscode-azureresourcegroups|ms-azuretools|0.10.11|ms-azuretools.vscode-azureresourcegroups-0.10.11|
|vscode-dotnet-runtime|ms-dotnettools|2.3.5|ms-dotnettools.vscode-dotnet-runtime-2.3.5|
|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.14.3|ms-windows-ai-studio.windows-ai-studio-0.14.3-win32-x64|;
Extension version: 2.81.17
VS Code version: Code - Insiders 1.101.0-insider (7197360b79e6da3404ed5ad1fb4d7ea74a8bb5d2, 2025-06-04T05:03:51.910Z)
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 (2.08GB 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:31309980
pythonpulldiag:31287486
6gi0g917:31259950
editoredits36407:31282444
996jf627:31264550
pythonrdcb7:31268811
usemplatestapi:31297334
e6194696:31317039
747dc170:31275146
pythonfullctx:31296836
6518g693:31302842
pylancecolor:31288664
generatesymbolt:31280541
convertfstringf:31280702
gendocf:31280703
923gi514:31310909
b99bg931:31306656
fd45d811:31320948
gg03i777:31307743
convertlamdat:31319677
gce3e431:31315077
```
Contributor guide
Assessment
This issue has not been assessed yet.