Search code examples
tfsmsbuildtfsbuilddatabase-projectsql-server-data-tools

sqlproj post-build $(Configuration) incorrect on TFS


I am writing a sqlproj using the latest version of SSDT but the post-build event $(Configuration) macro doesn't seem to be evaluated correctly using TFS.

I have written the following post-build event command within a project

"$(ProjectDir)$(ProjectName).Config\$(Configuration)\DeployCommand.cmd"

On my machine using visual studio this evaluates correctly to

"C:\Workspaces\MyProject\Dev\Src\MyProject.Database\MyProject.Database.Config\Debug\DeployCommand.cmd"

The above changes correctly as I switch between various build configurations (Release, UAT, etc) using the IDE. However using TFS 2012 it incorrectly (see the Debug folder) evaluates to (even though my build configuration is not set to Debug)

"C:\Workspaces\MyProject\Dev\Src\MyProject.Database\MyProject.Database.Config\Debug\DeployCommand.cmd"

I have other C# projects which correctly evaluate the $(Configuration) macro.

Anybody seen this before?


Solution

  • It turns out that my build configurations within the solution were very subtly wrong. I corrected them by hand.

    {31173859-02F5-4CFC-BD9A-C7BA45F8A7B7}.Dev|Any CPU.ActiveCfg = Dev|Any CPU
    {31173859-02F5-4CFC-BD9A-C7BA45F8A7B7}.Dev|Any CPU.Build.0 = Dev|Any CPU
    {31173859-02F5-4CFC-BD9A-C7BA45F8A7B7}.Dev|Mixed Platforms.ActiveCfg = Dev|Any CPU
    {31173859-02F5-4CFC-BD9A-C7BA45F8A7B7}.Dev|Mixed Platforms.Build.0 = Dev|Any CPU
    {31173859-02F5-4CFC-BD9A-C7BA45F8A7B7}.Dev|x86.ActiveCfg = Dev|Any CPU