TFS Build 2008 - Why is everything getting dumped in one folder? - tfs

When I build my solution, it dumps all the binaries into one folder. How can I cause it to split up the files by project like Visual Studio does?

Just edit your TFSBuild.proj file for the build, and add this to opne of the property groups:
<CustomizableOutDir>true</CustomizableOutDir>
This will automatically then cause the build to output the build output as per normal (like Visual Studio).

Related

Why isn't MSBuild with TFS 2017 copying content items in to the $(Build.BinariesDirectory) directory?

I have upgraded my company's TFS from 2013 to 2017. We still have our old XAML build definitions but are moving to the new JSON templates.
Most of the build definitions are working fine but some don't act like the former XAML definitions. I get all of the compiled assemblies in the $(Build.BinariesDirectory) folder but if I have a csproj that has Content items set to CopyAlways, they get copied to $(Build.SourcesDirectory), but they do not get copied into the $(Build.BinariesDirectory) for MSBuild. Project set up in Visual Studio
When building the old XAML build definitions they are copied to the bin directory fine: Build agent with the copied content
I have tried changing versions from 15 to the older 14 which still did not resolve this situation.
If you mean using the vNext build system, then you can add below msbuild arguments in the MSBuild Arguments area of the Visual Studio Build or MsBuild task to get the target files copied to the binaries directory.:
/p:OutputPath=$(Build.BinariesDirectory)
Note: The output is going to the \b\ folder, as the value of the variable $(Build.BinariesDirectory) is something like c:\agent\_work\1\b.
Build.BinariesDirectory :
The local path on the agent you can use as an output folder for
compiled binaries. For example: c:\agent\_work\1\b.
Source: Predefined variables

TFS 2013 build - Files copied using Post Build Event are not found

This is a winform application.
All dlls, exe and some other extension files are copied to the StartupProject\bin through the post build events(VS post-build).
On TFS Server, the project has 2 subfolders: bin and src.(bin contains required dlls, but other extensions are missing -.png, .dat, .xslx).
On the server, the post build copied files appear under the StartupProject\bin, but they are not copied to TFSFolder\bin.
How can I force copy all the StartupProj/bin to the TFSFolder\bin?
Team Build use a different directory layouts from Visual Studio builds. All Binaries go in a single folder for any project built, so references are automatically solved and it is easy to copy the DLL to the final Drop folder.
You should use $(OutDir) MSBuild variable to properly reference the binaries directory in VS and TFS builds. See Is there a single MSBuild and TFSBuild variable that will point to where the binaries are? for some details.
If you need to use different scripts for desktop (VS) and server (TFS) builds, use the $(BuildingInsideVisualStudio) variable as explained in TFS 2010 Build Automation and post-build event.

Getting TFSBuild.proj from TFS 2008 to work on TFS 2012

I just copied my Solution from TFS 2008 to TFS 2012. In TFS 2008 the TFSBuild.proj does the normal solution building, calls installshield projects, dotfuscator projects and dumps the resulting installshield output in the drop folder.
In my Build Definition I set the "Items to Build" to point to the .proj file. The build works, but all I get is one folder with the logs inside. I added the .sln to build (although didn't need to previously) and get the .sln files built but installshield and dotfuscator are not done.
Looking at the .proj log file... None of my "Message" outputs are there. Was there some large change between these two versions that would necessitate a big change in the proj file?
I do not have admin rights to the TFS servers.
thanks
I'm guessing that you are using the "Default" build process template. You need to use the "Upgrade" template if you want to use a TFSbuild.proj file.
Edit your build definition and go to the "Process" tab. There should be an area that shows which template you are using. Click on the "show details" button and choose the "Upgrade Template" from the drop down list.
Now point the build at the folder containing the TFSbuild.proj and save the definition. This should solve the problem.

tfs agent build required files

How can I set tfs build on agent to use one location for following files?
I have couple files that are run on after build of specific project.
files:
SomeFile.exe
RequiredDll.exe
I am using it for creating custom setups files, that is done from SomeFile.exe.
Now every time I have project that I want to run the actions, I need to copy files above into the project, which I know is wrong.
Is there any other way?
You can put these files in a common location within Source Control. Then in your build configuration you can map that common folder to a working folder for the build.
This is named slightly differently in the different versions of Visual Studio. In all versions it is found when editing a build configuration.
Visual Studio 2008 / 2010
Workspace
Visual Studio 2012
Source Settings
This allows you to map a source control folder to the Build Agents working build folder. You will then be able to access the same exe's in all your builds and they will only be in Source Control once.
A common practice is to have a Team Project dedicated to build artifacts. Then in your mappings you have something like this:
StatusSource Control FolderBuild Agent Folder
Active$/BuildProject/lib $(SourceDir)\BuildArtifacts

TFSBuild 2010 Package only contains sources - not binaries

The packages created by a TFS 2010 Build only contain our Sources, not the binaries. When this is (automatically) deployed to IIS, the site does not run because it is missing DLLs that are created during the build process.
We have a Web Project created in VS2010. If I select "Build Deployment Package" from a right click in VS we get a zip file in the obj\Release\Package folder that contains the fully build site.
However, if ask our TFS build process to create the package by adding "/p:CreatePackageOnPublish=true /p:DeployOnBuild=true" to the MSBuild arguments (as advised in amongst other places here) we get an zip file in _PublishedWebsites\_Package\.zip that only contains the sources.
My best guess is that the CopyAllFilesToSingleFolderForPackage is picking up the files from the wrong place.
I notice a similar issue asked here - TFS 2010 and creating a package - although his workaround in not appropriate in many cases, I'd guess.
My concern is that this is using a built-in, but poorly documented feature of MSBuild/TFS so when it doesn't work you're a little in the wilderness.
It seems that deployOnBuild runs some "package"-like target on each of the projects. If you have built the projects into a separate directory (which the default TFS 2010 build does by default) the packaging won't pick up the compiled files.
One solution is to get rid of the custom output folder for the MSBuild Command within the TFS build workflow. This will cause the compiled files to be located in-situ and be included in the package.
Now the rest of the TFS workflow is require some changes because it'll be expecting to transfer the files from the output directory, and they won't be there.

Resources