Search
Star
Feedback
Setup for Free
© 2026 Hedgehog Software, LLC
Twitter
GitHub
Discord
System
Light
Dark
More
Communities
Docs
About
Terms
Privacy
Compiler warnings about unused variables - C#
C
C#
•
15mo ago
•
8 replies
cheeze2000
Compiler warnings about unused variables
I have a simple program
var a = 40;
var b = a;
var c = 20;
Console.WriteLine(a);
var a = 40;
var b = a;
var c = 20;
Console.WriteLine(a);
On my vscode
, only
c
c
is underlined with this error
: The variable
'c
' is assigned but its value is never used
Why is
b
b
not underlined
? I mean it
's dimmed but why isn
't this a compiler warning as well
?
C#
Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871
Members
View on Discord
Resources
ModelContextProtocol
ModelContextProtocol
MCP Server
Recent Announcements
Similar Threads
Was this page helpful?
Yes
No
Similar Threads
Visual Studio (2022) is not underlining unused variables (and showing them as warnings)
C
C# / help
12mo ago
View compiler warnings without actually building the codebase?
C
C# / help
2y ago
Null Warnings
C
C# / help
16mo ago
NU1902 NU1903 warnings
C
C# / help
15mo ago