locked
Clean solution for VS Express RRS feed

  • Question

  • I cannot find the Clean solution command in Visual C# 2010 express editions. I opened the Customize dialog > Commands > Add Command... but it's not listed in any of the categories. However, when I brought up the Keyboard... dialog, I found Build.CleanSolution, along with other build related commands. When I invoked my assigned shortcut key to this command, it did the clean.

    Am I missing something in the settings?

    I do have VS2010 retail edition (pro) installed on the same machine. And I can find the build/clean commands in the VS2008 Express Customize dialog.

    Thanks!


    sorpor
    • Moved by Harry Zhu Monday, May 3, 2010 6:58 AM for better support. (From:Visual C# Express Edition)
    Wednesday, April 28, 2010 8:44 PM

Answers

  • It isn't considered to be a novice command since Rebuild Solution accomplishes the same thing.  To add the command do the following:

    1. Tools\Customize
    2. Commands tab
    3. Menu bar -> Build
    4. Add Command (Build -> Clean Solution)
    5. Select the Clean Solution command
    6. Put the command where you want it

    This command does not have a shortcut so if you want one then you'll need to use Tools\Options -> Keyboard to set it.  Note that the command shows up in the default layout but if it doesn't then you can try setting the Show all settings options in Tools\Options and the Show advanced build configuration in Projects and Solutions.

    Michael Taylor - 5/4/2010
    http://msmvps.com/blogs/p3net

     

     

    • Marked as answer by Harry Zhu Thursday, May 6, 2010 7:54 AM
    • Unmarked as answer by Sorpor Monday, May 10, 2010 9:37 PM
    • Proposed as answer by robert_nsu Thursday, June 17, 2010 2:09 PM
    • Marked as answer by Sorpor Thursday, August 5, 2010 7:56 PM
    Tuesday, May 4, 2010 2:02 PM
    Moderator
  • You are in basic settings mode.  To switch to expert do this: Tools\Settings -> Expert settings.  Now follow the steps above.

    Michael Taylor - 5/10/2010
    http://msmvps.com/blogs/p3net

    • Marked as answer by Sorpor Thursday, August 5, 2010 7:56 PM
    Monday, May 10, 2010 9:51 PM
    Moderator

All replies

  • It isn't considered to be a novice command since Rebuild Solution accomplishes the same thing.  To add the command do the following:

    1. Tools\Customize
    2. Commands tab
    3. Menu bar -> Build
    4. Add Command (Build -> Clean Solution)
    5. Select the Clean Solution command
    6. Put the command where you want it

    This command does not have a shortcut so if you want one then you'll need to use Tools\Options -> Keyboard to set it.  Note that the command shows up in the default layout but if it doesn't then you can try setting the Show all settings options in Tools\Options and the Show advanced build configuration in Projects and Solutions.

    Michael Taylor - 5/4/2010
    http://msmvps.com/blogs/p3net

     

     

    • Marked as answer by Harry Zhu Thursday, May 6, 2010 7:54 AM
    • Unmarked as answer by Sorpor Monday, May 10, 2010 9:37 PM
    • Proposed as answer by robert_nsu Thursday, June 17, 2010 2:09 PM
    • Marked as answer by Sorpor Thursday, August 5, 2010 7:56 PM
    Tuesday, May 4, 2010 2:02 PM
    Moderator
  • I can see what you described in non-express edition but in Visual Studio 2010 C# Express, there's no Menu bar -> Build (#3), nor the Build category in the Add Command dialog.

    I tried Show all settings and Show advanced build configuration in Tools > Options but still no luck.

    The trick in VS2010 Express is to enable Tools > Settings > Expert Settings! Once I enable this, I can see all the command categories.

    • Edited by Sorpor Monday, May 10, 2010 9:50 PM Found the answer
    Monday, May 10, 2010 9:44 PM
  • You are in basic settings mode.  To switch to expert do this: Tools\Settings -> Expert settings.  Now follow the steps above.

    Michael Taylor - 5/10/2010
    http://msmvps.com/blogs/p3net

    • Marked as answer by Sorpor Thursday, August 5, 2010 7:56 PM
    Monday, May 10, 2010 9:51 PM
    Moderator
  • I don't understand here:  Even using "Expert Settings", one still needs to manually modify the menu to get "Clean Solution" to show up in Visual Studio 2010 Express C#.

    On the flip side of the coin, in Visual Studio 2010 Express C++, this same menu command is visible by default when using "Expert Settings".

    Why would "Clean Solution" be considered an "advanced" command in C#, but not in C++?

    I would think that this concept would be uniformly applied across the different language versions of Visual Studio 2010.

    Tuesday, December 18, 2012 5:01 PM
  • It isn't.  C++ has lots of intermediary files - obj, pch, lib, etc.  As you add and remove source/header files and/or change compiler options you may cause some intermediary files to become stale or unneeded.  On rare occasions this can cause code to compile that shouldn't have (obj files from files from source files that no longer exist is a common scenario). 

    In contrast languages like C# or VB have almost no intermediary files.  All their files are regenerated on each build so there isn't any stale files to deal with.  Cleaning a native solution is common when you've made lots of project changes and when things aren't compiling quite right.  Contrarily it is rare to do so for managed code.  In either case a Rebuild Solution does the same thing.

    Tuesday, December 18, 2012 5:53 PM
    Moderator