Using TFS for Mixed C#/Managed C++ SharePoint Projects

Currently, I am doing a massive TFS migration for a health insurance company, and as part of the migration I am verifying build events for all their projects. Actually I am verifying almost 10 gigs of them, so it’s going to take me the better part of a month! Now aren’t you jealous.

I was migrating some managed C++ / C# SharePoint projects and noticed something very, very interesting.

With mixed language managed C++ projects, particularly, or at least in my case, when bundled with other C# projects, it might be noticeable that some of the compiled C++ projects don’t make it to the drop location. However, some do. While it appears sporadic, those that are referenced from the C# projects are still copied. After investigation I found the root cause is that managed C++ projects actually don’t consider some MSBuild properties. In this case, the problem is the lack of observance of the OutDir property. To understand this, consider the way that Team Build harvests outputs for managed C++ projects for the drop location, they override the OutputDirectory property (in vsprops). So if CustomizableOutDir is set to true, getting those compilations to the drop folder because a manual push.

How to fix it? Get TFS 08 SP1 which has a modified CustomizableOutDir property that lets you work around this! If this option is not on the menu, you can work with CompilationOutputs item group, or something similar, so that you can ultimately override some task with a Copy task to support cloning the files to the drop location.