views:

412

answers:

2

I wrote a Nant script that executes MSBUILD.exe to compile a project on my dev machine. On my dev machine, the projects builds its output to bin\x86\Release and my Nant script zips up the contents of that directory. I then commit everything to SVN and let TeamCity run the Nant script that executes MSBUILD.exe to compile the project and zip the output, but the output is created in bin\Release and the zip file is empty because it looks in bin\x86\Release. Why does this happen?

When I make changes to the configuration and platform in VS.NET 2008, I do not see the project file light up as being changed. Are these settings stored in the project file, solution file, or user configuration file and therefore not carried over to the build server?

+1  A: 

Quick fix: You can use the flag /property:OutDir=bin\x86\Release

You would have to find root cause of this. Probably configuration is incorrect. You can change configuration explicitly to something like /p:Configuration=Release

boredgeek
Thanks for the quick reply, but where do I pass that parameter? My Nant <exec> task passes these parameters:AllProjects.sln /t:rebuild /p:Configuration=${project.config}Do I just add another /p parameter?
flipdoubt
+1  A: 

Are you sure ${project.config} point to the same place in both local and TeamCity environments?

The agent are not always running with the sem environment variables as the local machine. So I would start out to check all properties and see where they point in the local machine as well as TeamCity.

As for the /p:Configuration=${project.config}, you can only have one configuration running but you can specify more properties with ; between them:

/p:Configuration=${project.config};OutDir=bin\x86\Release

haqwin
btw /p:xxx=yyy is short hand for /property:xxx=yyy
haqwin
According to the Nant output, ${project.config} evaluates to "Release" on both the dev and TeamCity machines
flipdoubt