C
C#2w ago
Eple

VS Code Fails to Highlight Missing Symbol in @code Section of .razor File

I couldn’t debug my app and wasn’t sure why at first. The only error I got was:
Unable to launch browser: "Could not open wss://localhost:7171/_framework/debug/ws-proxy?browser=...
Then I opened the solution in Rider, which pointed out the actual issue:
Cannot resolve symbol 'UseQuarterRequest'
VS Code didn’t flag this at all. It is in the @code section of a .razor file. Could there be something wrong with my VS Code setup? This is on macOS.
No description
No description
8 Replies
FusedQyou
FusedQyou2w ago
Might be $vsdrunk
MODiX
MODiX2w ago
* close VS * remove the hidden folder .vs * remove all bin and obj folder next to each csproj (DO NOT TOUCH THE .git FOLDER OR WHAT'S INSIDE) * restart vs
ero
ero2w ago
vscode
Eple
EpleOP2w ago
Thanks for the suggestions – unfortunately, deleting the bin and obj folders didn’t solve the issue. (Since I’m using VS Code, there’s no .vs folder to remove either.)
333fred
333fred2w ago
It doesn't look like you're using semantic highlighting That being said, it's rather hard to determine your issue with just what you've shown. Generally speaking, when Rider is giving you an error that dotnet build is not, Rider is wrong
Eple
EpleOP2w ago
I just ran dotnet build, and it throws the following error:
SupportWorker.razor(94,27): error CS0246: The type or namespace name ‘UseQuarterRequest’ could not be found (are you missing a using directive or an assembly reference?)
I also took a look at the Debug Console, and it shows the same error. The in-editor feedback seems to be a Rider-specific feature. Going forward, I’ll make sure to check the Debug Console or run dotnet build whenever I run into issues while using VS Code.
333fred
333fred2w ago
@davidwengier, any ideas?
davidwengier
davidwengier2w ago
Would need logs to know more. Doesn’t look like anything much is working.

Did you find this page helpful?