views:

554

answers:

2

Visual Studio 2008 Web Deployment Project Team Build ASPPARSE Error

I seem to have a common problem; one that is showing up but does not have a clear solution.

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.

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.

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.

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:

/xx.csproj/global.asax(1): error ASPPARSE: Could not load type 'xxx.xx.Global'.

The xx.csproj is the web application project and the 'xxx.xx.Global' is the Global.asax code behind class.

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.

<!-- 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.
  <Target Name="BeforeBuild">
  </Target>
  <Target Name="BeforeMerge">
  </Target>
  <Target Name="AfterMerge">
  </Target>
  <Target Name="AfterBuild">
  </Target>
  -->

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

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?

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?

A: 

I think you're bumping into a known issue that centres on the fact that TFS TeamBuild redirects the compilation outputs into a single folder (rather than bin\Release under each project).

I would point you in the direction of this post on Aaron Hallberg's blog which explains the issue and how to workaround it:

http://blogs.msdn.com/aaronhallberg/archive/2007/07/02/team-build-and-web-deployment-projects.aspx

JamesD
A: 

TFS 2010

If using TFS 2010 you should look at this http://blogs.msdn.com/jimlamb/archive/2010/04/13/customizableoutdir-in-tfs-2010.aspx

The article referenced above no longer applies

Simon_Weaver