visual-studio - how - visual studio windows title changer




Common Files in Visual Studio Solution (4)

Many times I have seen Visual Studio solutions which have multiple projects that share source files. These common source files are usually out in a common directory and in the solution explorer their icon shows up with a link arrow in the bottom left.

However, any time I try to add a source file to the project that is outside of that project's main directory, it just automatically copies it into the directory so that I no longer have a shared copy.

I found that I can get around this by manually opening the project file in a text editor and modifying the path to something like "../../../Common/Source.cs" but this is more of a hack then I would like.

Is there a setting or something I can change that will allow me to do this from within the IDE?



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.

Scott Hanselman posted on how to add it to your tools list at http://www.hanselman.com/blog/HackParallelMSBuildsFromWithinTheVisualStudioIDE.aspx.

I usually just run 'msbuild /m' from the command prompt or PowerShell, though.

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


Thanks @aku!

I knew this could be done, but I didn't know how to do this from Visual Studio. It shows up as a shortcut to the file and the csproj file generates the resulting XML like this:

<Compile Include="..\CommonAssemblyInfo.cs">
  <Link>CommonAssemblyInfo.cs</Link>
</Compile>

I've seen this technique commonly used for common AssemblyInfo files to keep a consistent version.


Tips and tricks for working with Microsoft Visual Studio solutions and project

First rule of working with Visual Studio:





projects-and-solutions