Upgrading from 1.9.1 to 1.9.3 not respecting OutDir/OutputPath

May 18, 2011 at 4:39 PM

Hey Eric - I'm upgrading a bunch of our internal projects to use 1.9.3 instead of 1.9.1.  We use TFS 2008 / TFS Build as well.  Since most of our project were .NET 4.0, I was using an external build targets file to run the Sandcastle build since it needed MSBuild 3.5.

With the MSBuild 4.0 support in 1.9.3, I was hoping to get rid of the special build targets file I was using and just build the .shfbproj file directly but it's not working.

We build both a Beta and Release configuration at the same time, dropping the binaries and output in their respective folders.  I've made sure to pass in both the OutDir and the OutputPath, and I've even added simple Message tasks to confirm the value of those fields on both the BeforeBuildHelp and AfterBuildHelp overrides you've specified in SandcastleHelpFileBuilder.targets.  When it builds Beta first, it uses the proper directory, when it builds Release, it uses the Beta path even though the OurDir/OutputPath says otherwise.

 

                Target BeforeBuildHelp:
                    Configuration = Release
                    OutDir = C:\Data\Source\Work\1\Client\Project\Main\TFSBuilds\ContinuousIntegration\TFSBuild.Local.Output\x86\Release\
                    OutputPath = C:\Data\Source\Work\1\Client\Project\Main\TFSBuilds\ContinuousIntegration\TFSBuild.Local.Output\x86\Release\\Documentation
                    TeamBuildOutDir = C:\Data\Source\Work\1\Client\Project\Main\TFSBuilds\ContinuousIntegration\TFSBuild.Local.Output\x86\Release\
                Target CoreBuildHelp:
                    Building C:\Data\Source\Work\1\Client\Project\Main\Sandcastle\Jerrys.ServiceCard.shfbproj
                    Initializing
                    FindingTools
                    ValidatingDocumentationSources
                    ... snip ...
                    CleanIntermediates
                    Completed
                    The help output is located at: C:\Data\Source\Work\1\Client\Project\Main\TFSBuilds\ContinuousIntegration\TFSBuild.Local.Output\x86\Beta\Documentation\
                    Build details can be found in C:\Data\Source\Work\1\Client\Project\Main\TFSBuilds\ContinuousIntegration\TFSBuild.Local.Output\x86\Beta\Documentation\LastBuild.log
                Target AfterBuildHelp:
                    Configuration = Release
                    OutDir = C:\Data\Source\Work\1\Client\Project\Main\TFSBuilds\ContinuousIntegration\TFSBuild.Local.Output\x86\Release\
                    OutputPath = C:\Data\Source\Work\1\Client\Project\Main\TFSBuilds\ContinuousIntegration\TFSBuild.Local.Output\x86\Release\\Documentation
                    TeamBuildOutDir = C:\Data\Source\Work\1\Client\Project\Main\TFSBuilds\ContinuousIntegration\TFSBuild.Local.Output\x86\Release\

Note how in both the BeforeBuildHelp and AfterBuildHelp, the output is specifiying Release.

I'm unsure as to why... for now I'll continue to use my external targets instead.

You do make mention of using some, "MSBuild 4.0 appears to expose a global public collection containing the currently loaded projects", here.  Perhaps this global collection is being used instead of the properties passed in?

Coordinator
May 18, 2011 at 7:23 PM

Make sure you're using the 03/26 refresh of the 1.9.3.0 release.  There was a problem with the first release of it that caused it to ignore command line property value overrides.

Eric