2
votes

Before we used TFS, we were building our packages locally using visual studio. There was a lot of projects organized into solutions. When we wanted to build the package, we simply located the ccproj project, right click on it and hit “package”.

There is couple of specific in our solution:

  • We use web roles with multiple web sites and virtual applications and we have them as project dependencies in VS2012 solution
  • We use config transformations for both web and worker roles. Worker roles transforms was achieved by adding transform target manually to the project file.
  • We have some additional class library projects – their outputs needs to go in a subfolder of the worker role along with correct configuration files, it is kind of plug-in architecture. We used some xcopy commands to include these non-referenced libraries in our worker roles.

Everything worked smoothly when building in VS 2012 locally.

When migrated to TFS we quickly learned that we won’t be able to replicate the same build process on build server

  • It turned out that TFS is not preserving solutions structure, more details here: http://social.msdn.microsoft.com/Forums/en-US/tfsbuild/thread/9ac815c8-5961-4670-a6d0-660a9b66da9c
  • The project dependency that was solving multiple web sites and virtual applications in a single role did not work on build server, probably because of different output directory. We had to add some hacks in our ccproj and csproj files to get these published and correctly included in the resulting package.
  • xcopy commands failed because of different directory structures on TFS build sever.
  • We had to force run cspack on TFS build server by explicitly adding /t:Publish parameter to msbuild command line.
  • Config transforms for worker roles did not worked, we had to force to occur using another hacks in the ccproj and csporj files.
  • There was more issues but those are too detailed. I would keep it on high level just to illustrate the whole issue. The build somehow works now, but we have now a lot of hacks in place now.

I have two questions:

  1. Is it possible to configure TFS build server to have exact same behavior as the local build in VS2012?
  2. Is there any official solution for building azure packages with multiple web sites and virtual applications in a single web role?
1

1 Answers

0
votes

I haven't yet tried this on a TFS build server, but the approach outlined in my blog at http://michaelcollier.wordpress.com/2013/01/14/multiple-sites-in-a-web-role/ has been working well. The "trick" is basically to modify the .ccproj file to tap into the CoreBuildDependsOn target, adding logic that will execute MSBuild against the secondary sites. This should also allow config transforms to work.