TFS 2012 build exclude some project from compilation process - tfs

I have some strange behavior in my automatic build. When I open solution properties in build workspace I find that there is one project not checked in configuration to build, and my build fails. When I open this solution from TFS source control, this project is checked and build in VS pass successfully. Does anyone have an idea of what can exclude the project from solution configuration in build process? Could there be any other reason for this problem?

Check out if the project is included in the Configuration Manager window (solution context menu), for the given flavor (Release/Debug) and CPU. TFS build is probably using another configuration.

Related

Nuget Restore in MS Build Step

In my asp.net web application, i have solution with 5 projects and nuget.org. In TFS Build Definition,
1) While building the whole solution in Visual Studio Build Task
Nuget packages getting restored.
2) While trying to generate executable files for individual projects in MS Build Task
If I select Restore Nuget packages, It's not finding nuget packages and step getting failed with message - "Process 'NuGet.exe' exited with code '1'."
I have tried many references online and none worked. Any suggestions on how to solve this?
Do i need to make any changes in the nuget.config file to support restoring
packages to individual projects.
Do not directly select Restore Nuget pacakges in MS build task configuration. This option is deprecated. To restore NuGet packages, add a NuGet Installer step before the build.
(Important) This option is deprecated. Make sure to clear this
checkbox and instead use the NuGet Installer build step.
Source Link: MSBuild
Besides, you could also build single project not the entire solution in Visual Studio Build task. Just select the project (.*proj) files instead of .sln file.
Unless you are building a customized MSBuild project file, then we recommend you use the MSBuild step instead of the Visual Studio Build step.
You could also try to build single project using Visual Studio Build task, see if the issue is still exists.
Same problem, downgraded to 4.4.1. it helped

Build for multiple configurations in TFS Build

Is it possible to make TFS Build 2017 to build binaries for all this configuration combinations:
VS2015, VS2017
Win32, x64
Debug, Release
Do I have to make a build step for each of this combinations, or can I use some sort of magic to do everything in a simple way.
You need to enable Multi-configuration in Options tab of build definition. Article: How do I build multiple configurations for multiple platforms?
After that, it will split configurations to multiple builds during the build.
For different vs versions, you need to add another step/task and select corresponding vs version.
You can specify the configurations that you want to build right on the compilation build step. Fill out the "configurations" text box with "release, debug" and the platform with "x86, x64".
You will need two steps for Visual Studio version...

TFS Build with PostSharp Debug | Any CPU

I have a .Net project (framework 4.0) that references PostSharp assembly (version 2.1). The project is configured for Debug and Release with Any CPU.
I'm trying to build that project on TFS (2012), created a build definition where I add two workspaces:
- One workspace with the directory where is the PostSharp.dll assembly
- One workspace where the .csproj file is.
The configuration I added is Debug | Any CPU.
When I attempt to build, it states that everything works fine but warns that my project doesn't have an OutputPath configured. After googling, I found out that it was related with the Any CPU, that should be AnyCPU without the space.
But if I do this, when TFS attempts to build my project it states that The type or namespace name "PostSharp" could not be found.
So if I use Any CPU TFS seems to recognize PostSharp, but if I use AnyCPU seems to recognize my project but not PostSharp.
Is there any workaround for this?
Thank you.
In the meantime I found the answer, it was the Build agent folder for my PostSharp assembly directory that was wrong. Works fine now.

How to compile all builds for a Delphi Project Group that has few projects in Delphi IDE?

I am using Delphi XE. Since Delphi 2007, it supports Project Group (.groupproj) that we may add projects into it.
We may define various build configuration for projects in "Build Configurations" e.g.: Debug and Release build.
Since Delphi 2010, a runtime variable $(Config) may be used to set Output Directory like: .\$(Config)
In this example, $(Config) translated to "Debug" for Debug build and "Release" for Release build respectively.
When Debug build is activated in build configuration, output file will stored in ".\Debug" folder relative to the current directory.
This is a nice feature so we may have output files stored in various folders for builds defined in Project's Build Configuration.
Furthermore, using the "Build" menu item in context menu (pop-up menu via mouse right click) of "Build Configuration" perform compilation for all builds underneath.
Unfortunately, I have more than 200 projects in my project group. Each project has Debug and Release build defined. I don't find any way to trigger an action to build Debug and Release build for 200 projects at once.
The only solution I knew so far is using View | Configuration Manager to change the active configuration before each build. However, that would marks all project as modified.
Please share your thoughts on how to compile all builds available to a project group.
Thank you.
I have added a item to the Explorer context menu for *.groupproj calling this *.bat:
call "C:\Program Files (x86)\CodeGear\RAD Studio\5.0\bin\rsvars.bat"
MSBuild %1 /t:Build /p:Configuration=Release
if errorlevel 1 goto Fehler
goto :EOF
:Fehler
pause
So I can do a release build from Explorer with two mouse clicks.

TFS does not build projects correctly

HI
I am trying to build my solution using TFS but it seems to skips the projects which have dependencies.
e.g Proj B depends on Proj A , then it builds only Proj A and not Proj B.
Also if i try to build the projects individually instead of the solution then it does not create the release folder. It says that the output path is not found.
Any help is much appreciated
thanks
Is the SLN file in question converted from an older version of Visual Studio?
I've found that sometimes, like when you upgrade from a VS2003 SLN file to a VS2008 SLN file, it fails in MSBuild (which is what TFS is doing essentially).
Try making a new SLN file in VS2008 (or whatever version you're using) with the same project and see if that fixes it...
If you right-click the solution, one option you'll have is dependencies. Make sure that the projects are correctly setup there, even though they may reference each other the dependencies on the solution itself may not be complete or accurate...and this is what MSBuild uses.
Have a look in the configuration manager and make sure that the build you are running has those projects selected to build.
It may be you are running the Debug configuration for your local build and then running Release on the TFS server and it's not configured the same.

Resources