<a href="http://www.micropoll.com/akira/mpview/585320-168921">Click Here for Poll</a><a href="http://www.questionpro.com" title="online surveys">Online Survey</a><BR> | <a href="http://www.micropoll.com" title="Website Polls">Website Polls</a><BR> | <BR><a href="http://www.micropoll.com/akira/MicroPoll?mode=html&id=168921">View MicroPoll</A></div>

Visual Studio 2010!

Read now >

Windows Mobile Development Thoughts

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.
ADVERTISEMENT
ADVERTISEMENT

 

DevSource.com: Your Source for Visual Studio on Facebook
ADVERTISEMENT
Working at the Visual Studio Command Line
By John Mueller

Rate This Article: Add This Article To:

Working at the Visual Studio Command Line - ' '
( Page 3 of 3 )

...And Lots More">

Running Your Application

Sometimes you'll work on an add-on, such as a library or service, to a main application. Every time you make a change to the add-on, you have to test the main application. Unless you want to run many copies of Visual Studio at the same time, you need a solution for running the main application quickly.

That's where the /Run (or /R) command line switch comes into play. You can create a shortcut that includes the /Run command line switch to compile and run the application. Because the application compiles before you run it, any changes to the add-on appear in the new run of the application.

If you don't need to keep the IDE open after the application runs, you can use the /Runexit command line switch. This command line switch works like the /Run command line switch. However, the IDE automatically closes when you finish running the application. You could use this feature with automated testing tools to run the tests and exit immediately. Any errors appear in the test suite log files. You could take the process a step further and ask the computer to analyze the log files automatically as well. The point is that you can add a significant amount of automation to the application test process by using this one command line switch.

Overcoming IDE Errors

Have you ever had the IDE suddenly decide not to work? If you experiment with third-party products at all, or build add-ins of your own, you've probably had the experience of not being able to work with the IDE. Some people approach the problem by reinstalling Visual Studio. However, there's a safer, easier, and more effective way to work through IDE problems. The following command line switches tell you how.

  • /ResetAddin AddinName: Resets the specified add-in. Essentially, this means that you won't see the add-in the next time you start the IDE. This article provides full details on how to perform this task.
  • /ResetSettings [SettingsFile]: Resets the entire development environment to default settings. You can use this option when your development environment becomes so useless that you can only regain control by resetting everything. As an option, you can supply the name of a settings file. The development environment will use these settings in place of the standard defaults. This article has additional information you should read before you use this option.
  • /ResetSkipPkgs: Resets the packages you have installed in Visual Studio. If you suddenly start receiving errors messages such as the ones described in this Knowledge Base article, you can use this command line switch to fix the problem.
  • /SafeMode: Starts the development environment using the minimal number of features. This is the command line switch to use when you're not sure whether a configuration setting is causing problems or your installation really is trashed to the point where you need to reinstall it. If the IDE won't start in safe mode, you can be sure that you need a fresh installation. See the article here for additional information.

Special Settings for Visual C++ Developers

The Visual Studio development environment has several command line switches specifically for Visual C++ developers. These command line switches don't affect anyone else because no one else has a need to use them. The following list tells you about these special command line switches.

  • /DebugEXE: Loads the project under control of the debugger. Using this option lets you enter debug mode automatically as part of loading the project. You can find additional information about launching the debugger automatically here.
  • /UseEnv: Uses the PATH, INCLUDE, and LIB environment variables defined by the Windows environment, rather than the environment defined in the IDE. Find additional information about setting the environment variables for command line builds here.

Working at the Command Line

In days gone by, developers spent most (sometimes all) of their time at the command line. The main reason for working at the command line was that older programming environments didn't provide an IDE. Newer products do provide an IDE that can save considerable time and effort when used correctly. However, there's still good reason to work at the command line: convenience and automation. Instead of killing your mouse finger all of the time, try using the command line instead.



 
 
>>> More Using Microsoft Visual Studio Articles          >>> More By John Mueller