title: MSBuild -- Use the .csproj file or roll your own?
body: <p>OK, so I readily concede that I'm a newbie when it comes to continuous integration.</p>
  
  <p>That being said, I'm trying to set up a CC.NET environment to educate myself, but I'm having trouble finding the information I need to get the automated build portion set up.</p>
  
  <p>As I understand it, in C# the .csproj file produced by VS 2005 and forward <em>is</em> a valid MSBuild file.  To wit, I've been able to integrate the MSBuild task into CC.NET using the .csproj file, but I have a few issues with this:</p>
  
  <ol>
  <li>There's a lot going on in here that I'm not sure I really need in an automated build environment.</li>
  <li>I didn't create this file.  I do not understand it, and that scares me. (<a href="http://www.pragprog.com/the-pragmatic-programmer/extracts/coincidence" rel="noreferrer">Programming By Coincidence</a>)</li>
  <li>Most of what is going on seems to be abstracted through <code>$(MSBuildToolsPath)\Microsoft.CSharp.targets</code></li>
  <li>As a result of 1, 2, and 3, modifying the file to include something like MbUnit seems convoluted and more difficult than it needs to be.  My only real option is to include it in the <code>AfterBuild</code> section, which seems kind of like a hack to me.</li>
  </ol>
  
  <p>So, a few questions for the CC.NET folks, the MSBuild folks, and the MbUnit folks.</p>
  
  <ol>
  <li>When using MSBuild, is it advisable to use the VS-generated .csproj file as the build file?  Or should I create my own?</li>
  <li>Should MbUnit tests be part of the MSBuild file or the CC.NET file?  My research seems to suggest that they belong in the MSBuild file.  If that is the case, do I create a new MSBuild .proj file and check that in to CVS in addition to the .csproj file?  Or does the MbUnit task become part of my .csproj file?</li>
  <li>Similar to question 2.  If I add the MbUnit tests to the MSBuild file and end up using the .csproj file, is the <code>Target Name="AfterBuild"</code> really the section to add that information?  Shouldn't there be a <code>Target Name="Test"</code> section?  Using the VS generated .csproj file seems to prevent the second option.</li>
  </ol>
  
  <p>I know there's a lot there, but most of what I've been able to find online assumes a certain level of familiarity with these topics that I just don't have -- unless I'm mistaken, the learning curve for this stuff isn't a curve at all, it's a step function. :)</p>
  
  <p>Edit 1: I updated the text to be a bit more concise and to address some lingering questions I've had with the answers.</p>