Skip to content
| Marketplace
Sign in
Visual Studio>Tools>Replace var With Type
Replace var With Type

Replace var With Type

Rishabh Verma

|
588 installs
| (4) | Free
This is a code refactoring extension based on the .NET Compiler Platform ("Roslyn") which replaces the usage of var with strong type equivalent.
Download

Visual Studio 2015 Extension to replace var with strong type.

Getting started

To try the varToType Extension:

  1. Download the VSIX.
  2. Install VSIX.
  3. Open a new instance of Visual Studio 2015 (tested only in VS 2015 as of now).
  4. Open a C# project, which has code files using var.
  5. On every usage of var, a light bulb style refactoring should be available.
  6. Click on light bulb or Ctrl+ . and it would show the preview of the fix.
  7. Choose to fix that instance, all instances in document, project or solution.
  8. On accepting, the fix is applied.var should be replaced with Fully qualified name as discovered.

    Screenshot

Replace var with Type Preview changes

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft