Skip to content
| Marketplace
Sign in
Visual Studio>Tools>VarAnalyzer
VarAnalyzer

VarAnalyzer

Francesco Bonacci

|
235 installs
| (1) | Free
VarAnalyzer is an Analyzer with Code Fix developed using the Roslyn platform. It allows users to get a warning each time they declare var construct in a non legit context. var keyword should just be used to incapsulate anonymous types and collection of anonymous types. Uses of...
Download

Var Analyzer with Code Fix

BEFORE READING

There are different schools of thought about var keyword usage. This analyzer is inspired byJeremy post.

Description

VarAnalyzer is an Analyzer with Code Fix developed using the Roslyn platform.

It allows users to get a warning each time they declare var construct in a non-legit context and it provides an option to infer the type.

var keyword should just be used to incapsulate anonymous types and collection of anonymous types. Uses of the var keyword for non-anonymous types make C# code hardly readable.

Product Screenshots

 

Analyzer:

 

Code Fix:


 

francesco.bonacci@studentpartner.com  |  twitter.com/francibon93 
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft