This is a problem I have been struggling with for several months now. Namely, when I work with my most flagship application, I can't use either RBS or RB4VS because in the pre-compilation phase it reports errors that do not exist in the regular code and during compilation in VS.
Errors are reported in the Program.cs file on lines that do not exist in the code at all, the file simply does not have enough lines for these errors to exist.
E:\RadzenApp\Bezra\Program.cs(496,34): error CS4033: The 'await' operator can only be used within an async method. Consider marking this method with the 'async' modifier and changing its return type to 'Task'.
E:\RadzenApp\Bezra\Program.cs(502,30): error CS4033: The 'await' operator can only be used within an async method. Consider marking this method with the 'async' modifier and changing its return type to 'Task'.
E:\RadzenApp\Bezra\Program.cs(524,21): error CS4033: The 'await' operator can only be used within an async method. Consider marking this method with the 'async' modifier and changing its return type to 'Task'.
Since this is the time of cooperation with artificial intelligence, I also talked to OpenCode about my problem. I received the following analysis so I am passing it on to you, it may be helpful.
It's an Electron app with its own logs (777 KB log.txt). Let me search the log for the phantom errors to see what RBS is actually analyzing:
$ Select-String -Path "C:\Users\ssy\AppData\Roaming\Radzen Blazor Studio\log.txt" -Pattern "CS4033|Program.cs" | Select-Object -Last 25 | ForEach-Object { $_.Line.Trim().Substring(0, [Math]::Min(300, $_.Line.Trim().Length)) }
(no output)
$ Select-String -Path "C:\Users\ssy\AppData\Roaming\Radzen Blazor Studio\log.txt" -Pattern "4033|error" | Select-Object -Last 20 | ForEach-Object { $_.Line.Trim().Substring(0, [Math]::Min(250, $_.Line.Trim().Length)) }
"text": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Threading.Tasks;\nusing Microsoft.JSInterop;\nusing Microsoft.AspNetCore.Components;\nusing Microsoft.AspNetCore.Components.Web;\nusing Radzen;\nusing Radzen.
"output": "<path>E:\\RadzenApp\\Erp\\Components\\Pages\\AddGKGKP.razor.cs</path>\n<type>file</type>\n<content>\n1: using System;\n2: using System.Collections.Generic;\n3: using System.Linq;\n4: using System.Threading.Tasks;\n5: using Microsoft.JSInte
"text": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Threading.Tasks;\nusing Microsoft.JSInterop;\nusing Microsoft.AspNetCore.Components;\nusing Microsoft.AspNetCore.Components.Web;\nusing Radzen;\nusing Radzen.
[2026-07-21 11:58:00.296] [error] Roslyn LSP ERROR: [textDocument/semanticTokens/full] [LSP] StreamJsonRpc.LocalRpcException: Failed to get language for textDocument/semanticTokens/full
[2026-07-21 11:58:00.297] [error] Roslyn LSP request failed: textDocument/semanticTokens/full file=30 Error: Failed to get language for textDocument/semanticTokens/full
[2026-07-21 11:5…
Click to expand
+ Thought: 17.3s
The log is gold. RBS runs its own Roslyn LSP server, and its project loader is failing to reload projects ("Error while loading...csproj", "sdk\10.0" ArgumentException, package downgrade warnings-as-errors). Let me check for Bezra-specific entries:
$ Select-String -Path "C:\Users\ssy\AppData\Roaming\Radzen Blazor Studio\log.txt" -Pattern "Bezra" | Select-Object -Last 15 | ForEach-Object { $_.Line.Trim().Substring(0, [Math]::Min(280, $_.Line.Trim().Length)) }
[2026-08-02 03:03:54.215] [info] Copilot workspace path changed from null to E:\RadzenApp\Bezra
[2026-08-02 03:04:00.732] [info] GitHub Copilot service started for window 1: E:\RadzenApp\Bezra
[2026-08-02 03:04:03.216] [info] Roslyn LSP started for workspace: E:\RadzenApp\Bezra
+ Thought: 26.2s
Bezra's workspace was opened in RBS today at 03:04. Let me check the older log for the actual CS4033 diagnostics to pinpoint what content RBS analyzed:
$ Select-String -Path "C:\Users\ssy\AppData\Roaming\Radzen Blazor Studio\log.old.txt" -Pattern "4033" | Select-Object -First 5 | ForEach-Object { $_.Line.Trim().Substring(0, [Math]::Min(300, $_.Line.Trim().Length)) }; "---"; Select-String -Path "C:\Users\ssy\AppData\Roaming\Radzen Blazor Studio\log.old.txt" -Pattern "Bezra.*csproj|Bezra.*load" | Select-Object -Last 5 | ForEach-Object { $_.Line.Trim().Substring(0, [Math]::Min(300, $_.Line.Trim().Length)) }
---
+ Thought: 26.2s
Investigation complete. Here's the definitive answer:
Why Radzen Blazor Studio shows errors at lines that don't exist
The evidence chain:
1. RBS doesn't use your compiler or VS — it hosts its own Roslyn LSP server. Its log (%APPDATA%\Radzen Blazor Studio\log.txt) shows: Roslyn LSP started for workspace: E:\RadzenApp\Bezra (today, 03:04). Diagnostics come from that language server, not from dotnet build (which passes clean, 0 errors).
2. An LSP server analyzes the buffer the editor sends it — not the disk file. If RBS has Program.cs open with a stale/restored buffer (Electron Session Storage restores open tabs), or its file-watcher failed to reload after external changes, Roslyn analyzes the old text and reports errors at old line numbers — 496/502/524, which can't exist in the current 451-line file.
3. RBS's project loader is demonstrably failing on this machine. The log is full of:
[LanguageServerProjectLoader] Error while loading ...csproj: Warning As Error: Detected package downgrade...
Exception thrown: System.ArgumentException: 'C:\Program Files\dotnet\sdk\10.0...'
When a project reload fails (e.g., after my external edits triggered workspace/didChangeWatchedFiles), the workspace keeps the old snapshot → diagnostics never refresh.
4. Each error listed twice = RBS's error panel surfacing duplicate LSP publishes (two analysis sources) — same pattern as VS's Build+IntelliSense.
5. No git version of Program.cs ever had await at those lines — the buffer RBS is analyzing is an intermediate editing state that was never saved to disk (one that had awaits inside a non-async method/lambda, hence CS4033).
The plan (RBS-side actions)
1. Open Program.cs inside RBS's own editor — check the line count. If it shows anything other than 451 lines / no AddRadzenLocalization() at ~line 380, RBS is holding a stale buffer. Close the tab WITHOUT saving (saving would overwrite the good disk file!) and reopen from disk.
2. Fully quit and restart RBS — kills the Roslyn LSP process and forces a fresh workspace load from disk.
3. If errors survive the restart: with RBS closed, clear its Electron caches — Cache, Code Cache, Local Storage, Session Storage under %APPDATA%\Radzen Blazor Studio. This wipes the restored editor state. (I can do this for you once plan mode is exited and RBS is closed.)
4. Update Radzen Blazor Studio — the SDK 10.0 ArgumentException in the log means its bundled project loader is choking on your installed .NET SDK; a loader failure is exactly what freezes diagnostics. Newer RBS builds fix SDK compatibility.
Bottom line: your code is correct — dotnet build proves it. The errors are a caching/staleness artifact inside RBS's own language server, triggered by its failure to reload the project after the file changed externally.