Building vcproj together with csproj TFS2012

666 Views Asked by At

I am working with Visual Studio 2012 build definitions with TFS2012, and one definition is set to build a solution that contains both .csproj and .vcproj (c# and c++, respectively). I can run a local build of the solution on the build server and it works great, the build output shows that all of the projects (most significantly the c++ projects) are built; prebuild, postbuild, the whole nine yards. However when I run the build definition that builds the very same solution the c++ projects are seemingly not built. The build report returns with no errors, however the build log returns only the following for the c++ projects:

C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE....\vc\vcpackages\VCBuild.exe /override:"[path to solution file].Mixed Platforms.Debug.vsprops" [path to project file] "Debug|Win32"

What I am hoping to see is a much longer build report (indicating that the project actually built), but alas I am left with what seems like a lack of an attempt to build the c++ projects. Not to mention the build output does not contain any assemblies or .pdb's from the c++ projects.

To extinguish any thoughts that the problem is with not having Visual Studio 2008 installed, the build server does have Visual Studio 2008 installed, and I have already performed a full repair to ensure that all of the correct files are in place (things like vcbuild.exe and vcprojectengine.dll).

Any ideas why the c++ projects are not building? Thanks for any help!

UPDATE__________________

The issue has changed. Due to some pretty slim build logging I was under the impression that the c++ project wasn't building (I ran with this idea because I wasn't seeing any project outputs in the specified build definition drop location). After a bit of investigation (and some very helpful suggestions!) the problem has been focused down to simply that the c++ project output directory property does not dynamically change as a C# property would. Manually changing these values and running build definitions has proved that the build definition uses the default output directory properties for the C++ project file.

My temporary solution is to do a little scripting to copy these outputs to the folders I need. To further my post's question, is there any setting to have these C++ project output directory properties change dynamically as a C# project would?

3

There are 3 best solutions below

2
On

Right click on your solution and open the configuration manager.

Once you are there you can specify the configuration in which you are building and specify the projects that needs to be built and in which platform. If you open the DEBUG configuration you would know how the C++ projects are configured (Which configuration, platform and whether it needs to be built or not).You can copy over the same settings for the "configuration" that you are using within your build definition.

Open your build definition -> edit build definition -> Process -> Items to Build -> you can select the configuration here

Open your build defintion -> go to Process -> Advanced -> Set the MSBUILD Platform as "x86". THis should fix it.

3
On

Thanks for the response! Unfortunately I have addressed the configuration manager many times. Since the solution is a mix of c# and c++ projects, the configuration/platform I am currently running is DEBUG/MIXED PLATFORMS. All of the projects are selected to build, and even more I ran a DEBUG/WIN32 build definition (to target the c++ projects only) and the only output I received from the log with regards to each c++ project is:

C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE....\vc\vcpackages\VCBuild.exe /override:C:[path to solution].Win32.Debug.vsprops C:[path to project file] "Debug|Win32"

That is the only output in the log file regarding my c++ project. Any ideas what the build process is attempting to do?

0
On

I think your problem is something I've just encountered myself. By default, TFS2012 uses a different build output structure than what you have defined in your projects.

So if you are expecting some output directory to be "Debug" or "....\Debug", etc, it will fail.

The solution is to open your build process template xaml file in a text editor. Search for "OutDir" and delete those entries. (I only had one)

Here are the links where I learned this:

http://blogs.msdn.com/b/jimlamb/archive/2010/04/13/customizableoutdir-in-tfs-2010.aspx

http://social.msdn.microsoft.com/Forums/vstudio/en-US/7126f1a3-9437-416a-88ed-2f63f84b2937/tfs-buildmsbuild-2010-bin-folder-auto-redirection-to-binaries-folder-not-redirecting-all-projects?forum=tfsbuild