title: Web Deployment Project Team Build Error
body: <p>Visual Studio 2008 Web Deployment Project Team Build ASPPARSE Error</p>
  
  <p>I seem to have a common problem; one that is showing up but does not have a clear solution.</p>
  
  <p>I have a Visual Studio 2008 project structure that contains several projects that are class libraries, a web application project, and a recently added web deployment project.  I've heard of this issue with MVC setups.  Also, the solutions that I've seen assume that MVC is being used.</p>
  
  <p>I have verified that the build works correctly from the IDE.  I have not changed the defaults of the web deployment project except for the name of the assembly it produces as a result of the single assembly merge.</p>
  
  <p>I've set my solution to build the web deployment project only when the solution is built for "Release".  I have a custom build script that grabs this branch of code and a development branch of code.  The build script correctly builds the release version of this code and the debug version of the development branch.</p>
  
  <p>The problem comes when building the release version.  All the projects build sucessfully except for the web deployment project.  TFS Build errors when building this project with the following error:</p>
  
  <pre><code>/xx.csproj/global.asax(1): error ASPPARSE: Could not load type 'xxx.xx.Global'.
  </code></pre>
  
  <p>The xx.csproj is the web application project and the 'xxx.xx.Global' is the Global.asax code behind class.</p>
  
  <p>From my reading it seems like there may be some copying issue with TFS Build.  I've read several responses here regarding MVC.  This is not a MVC setup, but I believe it is of a similar issue.  I'm not sure where any copying code should go.  I've tried placing some suggested code in my AfterBuild target in the TFSBuild.proj file but found code didn't change this error.</p>
  
  <pre><code>&lt;!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
         Other similar extension points exist, see Microsoft.WebDeployment.targets.
    &lt;Target Name="BeforeBuild"&gt;
    &lt;/Target&gt;
    &lt;Target Name="BeforeMerge"&gt;
    &lt;/Target&gt;
    &lt;Target Name="AfterMerge"&gt;
    &lt;/Target&gt;
    &lt;Target Name="AfterBuild"&gt;
    &lt;/Target&gt;
    --&gt;
  </code></pre>
  
  <p>The code above appears int the project file commented out.  My thinking is that the 'BeforeMerge' target would let me copy those binaries that are needed.  I do not know how to write any script to do this.  I've consulted a couple of TFS books but neither of them contain information regarding web deployment projects.  (Much to my chagrin it seems that I cannot find much information from Microsoft in regards to this issue as well).</p>
  
  <p>Seeing that I've only seen solutions that reference MVC solutions I should say that I've looked into doing stuff in the AfterBuild target.  The build script above is directly from the deploy_csproj where I've tried it in the TSBuild script.  Is there a difference to attempting to copy binaries in either location?</p>
  
  <p>Can anyone explain what is going on?  Do I have to write individual build scripts for each project so that they copy their binaries to the correct directory for merge execution?</p>