<p>After answering on <a href="https://stackoverflow.com/questions/45650/common-files-in-visual-studio-solution#45664">this question</a> I thought it would be nice to collect some tips &amp; tricks for working with MSVS solutions and projects.  </p>

<p>Here is my list:  </p>

<ul>
<li><p>How to avoid saving new projects
automatically to reduce garbage in
file system.</p>

<p>Uncheck <strong>Tools->Options->Projects and Solutions->Save new projects when created</strong></p></li>
<li><p>How to add common file to multiple
projects without copying it to
project’s directory.</p>

<p>Right click on a project, select <strong>Add->Existing Item->Add as link</strong> (press on small arrow on Add button)</p></li>
<li><p>How to add project to solution
without including it in the build
process</p>

<p>Right click on solution, select <strong>Add->New solution folder</strong>.<br>
Right click on created folder, <strong>select Add->Add existing project</strong></p></li>
<li><p>How to edit project file from Visual
Studio?</p>

<p>Right click on project and select <strong>Unload Project</strong>, right click on unloaded project and select <strong>Edit</strong>.
Or install <a href="http://code.msdn.microsoft.com/PowerCommands" rel="nofollow noreferrer">Power Commands</a> and select <strong>Edit Project File</strong></p></li>
<li><p>How to group files in the project
tree (like auto-generated files for
WinForms controls)</p>

<p>Open project file for editing.  </p></li>
</ul>

<pre>   Change</pre>

<pre><code>&lt;Compile Include="MainFile.cs" /&gt;
&lt;Compile Include="SecondaryFile.cs" /&gt;

To

&lt;Compile Include="SecondaryFile.cs "&gt;
    &lt;DependentUpon&gt; MainFile.cs &lt;/DependentUpon&gt;
&lt;/Compile&gt;
</code></pre>

<p>Do you have anything else to add?</p>

[{'answer_id': 45995, 'author': 'Craig', 'author_id': 2894, 'author_profile': 'https://Stackoverflow.com/users/2894', 'pm_score': 2, 'selected': False, 'text': '<p>I like changing the default location that new projects are saved to.  </p>\n\n<p>Tools->Options (Select Projects and Solutions tab) </p>\n\n<p>This "tab" has all sorts of goodness.  Not just the ability to change the default locations and avoid saving new projects automatically but other nice things as well.  For example:</p>\n\n<p>Track Active Item - Selects the file in the solution explorer when you change windows.</p>\n\n<p>Show Output window when build starts - Toggle to show or not.  I like it on, your mileage will vary.</p>\n'}, {'answer_id': 46275, 'author': 'Owen', 'author_id': 4790, 'author_profile': 'https://Stackoverflow.com/users/4790', 'pm_score': 1, 'selected': False, 'text': '<p>I have a tip regarding the "Track Active Item" option mentioned above, for when working with big projects. It\'s posted here:</p>\n\n<p><a href="https://stackoverflow.com/questions/31163/forcing-the-solution-explorer-to-select-the-file-in-the-editor-in-visual-studio#46193">Forcing the Solution Explorer to select the file in the editor in visual studio 2005</a></p>\n'}, {'answer_id': 46300, 'author': 'David Mohundro', 'author_id': 4570, 'author_profile': 'https://Stackoverflow.com/users/4570', 'pm_score': 3, 'selected': False, 'text': '<p>I\'m a huge fan of using msbuild to build my solutions with the /m option so that it builds using multiple cores. It can drastically decrease your build time.</p>\n\n<p>Scott Hanselman posted on how to add it to your tools list at <a href="http://www.hanselman.com/blog/HackParallelMSBuildsFromWithinTheVisualStudioIDE.aspx" rel="nofollow noreferrer"><a href="http://www.hanselman.com/blog/HackParallelMSBuildsFromWithinTheVisualStudioIDE.aspx" rel="nofollow noreferrer">http://www.hanselman.com/blog/HackParallelMSBuildsFromWithinTheVisualStudioIDE.aspx</a></a>.</p>\n\n<p>I usually just run \'msbuild /m\' from the command prompt or PowerShell, though.</p>\n\n<p>Another tip that is sometimes useful is taking advantage of the pre- and post-build events to add additional logic before or after a build. To see these, go to the Properties for a Project, click on the Compile tab, and then choose "Build Events..."</p>\n'}, {'answer_id': 54112, 'author': 'Gulzar Nazim', 'author_id': 4337, 'author_profile': 'https://Stackoverflow.com/users/4337', 'pm_score': 2, 'selected': False, 'text': '<p>I love debugging with the <a href="http://blogs.msdn.com/saraford/archive/2008/07/28/did-you-know-you-can-start-debugging-multiple-projects-268.aspx" rel="nofollow noreferrer">Multiple startup projects option</a></p>\n'}, {'answer_id': 156311, 'author': 'Mario', 'author_id': 472, 'author_profile': 'https://Stackoverflow.com/users/472', 'pm_score': 2, 'selected': False, 'text': '<p>Using the command window to quickly open files in your solution:</p>\n<ol>\n<li>Bring up the Command Window (<kbd>CTRL</kbd>-<kbd>ALT</kbd>-<kbd>A</kbd>)</li>\n<li>Type <code>open &lt;filename&gt;</code></li>\n</ol>\n<p>I create an alias for <code>open</code> by executing the following at the Command Window: <code>alias o open</code>.  Visual Studio will remember the alias from then on, so I only ever need to type <code>o &lt;filename&gt;</code>.</p>\n<p>It even searches database projects unlike some third-party plugins!</p>\n<p>Unfortunately, there is a bug in the filename completion when searching for nested files.  A simple workaround is to type the beginning of the filename, hit the <kbd>ESC</kbd> key and then type the rest of the name.  To search for login.aspx.cs, type <code>login.aspx</code>, hit <kbd>ESCP</kbd> and then type <code>.cs</code>.</p>\n'}, {'answer_id': 157179, 'author': 'Rinat Abdullin', 'author_id': 47366, 'author_profile': 'https://Stackoverflow.com/users/47366', 'pm_score': 4, 'selected': False, 'text': '<p>First rule of working with Visual Studio:</p>\n\n<ul>\n<li><strong>Install <a href="http://www.jetbrains.com/resharper/" rel="noreferrer">ReSharper</a></strong></li>\n</ul>\n'}]
['https://Stackoverflow.com/questions/45908', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1196/']