Skip to content
| Marketplace
Sign in
Visual Studio>Tools>Var Replacer C#
Var Replacer C#

Var Replacer C#

Peter Spada

|
4,410 installs
| (7) | Free
This C# analyzer plugin will help you replace "var" with the actual type name. Use the light bulb to change it. If you want to have "var" show up as a warning or error, you can create a custom .ruleset file for your solution.
Download

Updates

  • 1.6: Added support for VS 2017
  • 1.4: Fix (ignore) anonymous types in collections
  • 1.3: No more red underlines by default (can be customized though)
  • 1.2: Added support for foreach(var...)

Description

This is a C# Roslyn code analyzer that will help you replace var with the actual type name by using the Ctrl-. shortcut, or clicking the light bulb. Just put the text cursor inside of var in C# code to get started.

To control if var is underlined as an error, warning, etc. you can add a custom .ruleset file to your solution. Here is how to create one:

  • https://msdn.microsoft.com/en-us/library/dd264974.aspx

Here is how to use a custom .ruleset:

  • https://msdn.microsoft.com/en-us/library/dd465181.aspx
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft