We have this project, that is developed in house and at an outside contractor. Recently, we purchased and installed BuildMaster and tried to use it to automatically publish this project as well. As it occurs, it is not as easy to publish a .NET 3.5 web application as it is from Visual Studio.

To cut the long story short… After several hours of research, hair pulling and quiet swearing, I found a solution that works. So, if you want to publish a web application with references to another project with MSBuild, you need to run it like this:

cd /D x:\Source\myApp\
c:\Windows\Microsoft.NET\Framework\v3.5\MSBuild.exe /target:ResolveReferences;_CopyWebApplication /p:Configuration=Release;WebProjectOutputDir=X:\Builds\myApp\;OutDir=X:\Builds\myApp\bin\ myApp.csproj

Then, just move the contents to final destination.