Add Ons - DevSource
DevSource: Microsoft Developer Resource DevSource Home Sponsored by Microsoft Home Add Ons Architecture Languages Techniques Using VS Forums
Home arrow Add Ons arrow Page 2 - Visual Studio Command Line Switches
Visual Studio Command Line Switches
By Steve Andrews

Rate This Article: Add This Article To:

Visual Studio Command Line Switches - Add-ins and Packages
( Page 2 of 2 )

Fixing Add-Ins and Packages

There are times when add-ins and managed packages don’t function properly and can cause the IDE to crash, hang or behave in unexpected ways. Before you go through the process of uninstalling Visual Studio, and possibly multiple versions, there are some command-line switches you can try.

ADVERTISEMENT

Before you use the command line switches however, there is a trick you can use to determine if an add-in is causing any problems you are experiencing. If you start Visual Studio while holding down either shift key, add-ins will be disabled for the session.

Visual Studio also contains an Add-In Manager dialog within the IDE. You can navigate to the dialog by going to Tools | ‘Add-in Manager…’ By adding or removing a check from the various checkboxes, you can control which add-ins are available in current and future sessions , which are loaded at startup, and which are available from the command line respectively. However, you can also control add-in behavior from the command-line as you start Visual Studio. Here are some switches:

/ResetAddin

If you want to remove an add-in, either permanently or temporarily so you can later re-install it, use the /ResetAddin switch. This switch will remove any commands and user interface elements associated with the add-in.

The syntax to use is:

devenv /resetaddin Namespace.ClassName

The other method to removing add-ins if you aren’t sure of the Namepsace or ClassName, is to remove the add-in XML registration file located by default in:

<My Documents>\Visual Studio 2008\Addins

/ResetSettings

In some cases, you may wish to reset Visual Studio to its original state. This switch resets the Visual Studio environment, including all user settings back to the Microsoft-supplied defaults. Or you can optionally reset Visual Studio to the state saved in a settings file by providing the path to the file.

The syntax to use is:

devenv /ResetSettings <SettingsFile>

It is helpful as well to understand what the settings files are and when it is a good idea to use them. Settings files are Visual Studio’s way of saving user settings in case they need to be restored in the future. Within the IDE, you can access the Settings dialog by going to Tools | ‘Import and Export Settings…’ The three choices, which are pretty self-explanatory, allow you to Import, Export and Reset your environment settings. It is important to note that changing or resetting the environment setting is on a per-user basis. Therefore, you’ll probably want to create a settings file once you have initially customized Visual Studio, as a rapid mechanism for restoration in case anything gets messed up in your IDE.

/ResetSkipPkgs

If managed packages are causing a problem with the IDE, you may receive an error message similar to the following:

Package '<Package Name>' has failed to load properly

You’ll be asked whether to skip the package. If you choose yes, Visual Studio disables the package by appending renaming the package’s filename extension to the file. Running /resetskippkgs tells Visual Studio to remove the extension from the file, and re-enable all packages.

/SafeMode

Another way to prevent add-ins from loading is with the /safemode switch. When this switch is used, only the required environment components will be loaded.

/Log

To help diagnose problems with Visual Studio, you can start the IDE with the /log switch, which logs add-in and VSPackage information to the specified log file. A new log file will be created if it doesn’t already exist. If a log file is not specified, it will be created by default in:

%AppData%\Microsoft\VisualStudio\9.0\ActivityLog.xml

The syntax to use is:

devenv /log [<full log file path>]

/NoVSIP

If you have been working with creating managed Visual Studio packages, you may wish to test their execution under a non-SDK environment. By using the /NoVSIP switch, you can tell Visual Studio to load only the packages which contain valid package load keys.

/setup

If one or more of your VSPackages are causing problems with the UI, you can use the Setup switch to have Visual Studio re-load the menus, toolbars and command groups from the installed packages.

The syntax to use is:

devenv /setup

Conclusion

While the Visual Studio graphical environment provides all the necessary tools and command to work with projects and solutions, the command line utilities provides many mechanism for automating tasks and resolving issues with Visual Studio.

ges are causing problems with the UI, you can use the Setup switch to have Visual Studio re-load the menus, toolbars and command groups from the installed packages.

 
 
>>> More Add Ons Articles          >>> More By Steve Andrews
 



HD VOIP Has Arrived (with Tony Konstner)

Play Video >

All Videos >

Google and blonde jokes?

Read now >

Favorite books!

Read now >

View Now
DevSource RSS FEEDS
XML Want an easy way to keep up with breaking tech news? And the Get DevSource headlines delivered to your desktop with RSS.