CustomizableOutDir in TFS 2010 with ASP.Net Projects


 

Jim Lamb has blogged about how to CustomizableOutDir using Team Build 2010 as you might want have the assemblies dropped in a custom Folder structure instead of having all assemblies in one Drop Folder, which is the default behavior.

When applying this workaround to a Solution containing an ASP.Net Project you might be missing the _PublishedWebsites folder in the Drop Folder structure:

image

Assuming you have configured the Team Build Workflow as Jim suggested:

image

You can workaround the problem by using a different definition for OutputPath and OutDir in the Webapplication.csproj File:

<PropertyGroup Condition=" ‘$(Configuration)|$(Platform)’ == ‘Debug|AnyCPU’ ">
    <DebugSymbols>true</DebugSymbols>
    <DebugType>full</DebugType>
    <Optimize>false</Optimize>
    <OutDir Condition=" ‘$(TeamBuildOUtDir)’!=”">$(TeamBuildOutDir)\$(SolutionName)\$(MSBuildProjectName)\</OutDir>
    <OutputPath>bin\</OutputPath>
    <DefineConstants>DEBUG;TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
</PropertyGroup>

The reason why it’s failing is because the _CopyWebApplication Target will be skipped. To figure out if this is the case you can check your MSbuild log  fole the following line: 

Target "_CopyWebApplication" skipped, due to false condition; (!$(Disable_CopyWebApplication) And ‘$(OutDir)’ != ‘$(OutputPath)’

That’s it. The Issue has been already reported via Connect.

Comments (4)

  1. Pradeep Y says:

    Hi,

    Useful post, but I am getting below error: I would appriciate any help.

    MSBUILD : error MSB1005: Specify a property and its value. Switch: /p:SkipInvalidConfigurations=true;TeamBuildOutDir=C:Builds1TFSDemoBuild_TFSCommonBinaries;  For switch syntax, type "MSBuild /help"

    Thank You

    Pradeep Y.

  2. cbinder says:

    Hi,

    can you share the xaml Build Workflow and your Webapplication.csproj File via the Feedback option.

    Thx

    Chris

  3. Pradeep Y says:

    Changed Command line argument as below, and it is working as expected.

    String.Format("/p:SkipInvalidConfigurations=true /p:TeamBuildOutDir=""{0}"" {1}", BinariesDirectory, MSBuildArguments)

    Thank you Chris.

    – Pradeep Y

  4. Kevin V says:

    Web site projects don't have project files to edit.