Friday, March 08, 2013

TFS 2010 Build Automation - Issue with Solution with external project in another Source Control Folder

    Issue.


    Backgroud on TFS Structure:
    >***** Top level project (***** for security purpose)
    --- Development
    ---XX
    ---XXirect* (This is what I am attempting to build, more details below)
    --- QA
    --- Root

    Actual solution through Solution Explorer
    XXirect-2.5.6.sln (Includes the following projects)

    --XXirect (In the XXirect Folder)
    --XX_CommonMethods (In the XX Folder aka referenced project)

    Under the build definition if have the following:
    Status
    Source Control Folder
    Build Agent Folder
    Active
    $/*****/Development/XX/XX_CommonMethods
    $(SourceDir)\XX\XX_CommonMethods
    Active
    $/*****/Development/XXirect
    $(SourceDir)

    When I build I get the following error:
    $/*****/Development/XXirect/XXirect-2.5.6.sln - 1 error(s), 103 warning(s), View Log File
    C:\Builds\4\*****\XX_DEV - Draft\Sources\XXirect-2.5.6.sln.metaproj: The project file "C:\Builds\4\*****\XX_DEV - Draft\Sources\..\XX\XX_CommonMethods\XX_CommonMethods.csproj" was not found.

    I have another build that I copied this template for that works fine. It actual builds to the build server (both containing the controller (m) and agent (007). Actually those are their names, just thought it was great how you explained that in the training.

    The build actually builds then copies _Published folder to another server, which works fine. Again the issue I believe lies in the Mapping…
    Any help would be great.


    FIX

    Try the following
    Status
    Source Control Folder
    Build Agent Folder
    Active
    $/*****/Development/XX/XX_CommonMethods
    $(SourceDir)\XX\XX_CommonMethods
    Active
    $/*****/Development/XXirect
    $(SourceDir)\XXirect


    Ahmed is an independent consultant in Ottawa, Canada specialized in .NET, Biztalk, WCF, WPF, TFS and other Microsoft technologies.
    Blog: http://lajak.wordpress.com
    Twitter: ahmedalasaad



    Ahmed Al-Asaad - 5 STARS... You are the man. You suggested fixed the issue. Thank you so much.
    I am writing the following for the MSDN community to help them as well.
    Yesterday, I tried building individual projects instead of the .sln
    In the Build Definition the two sections that are critical to this.

    Workspace

    tatus
    Source Control Folder
    Build Agent Folder
    Active
    $/*****/Development/XX/XX_CommonMethods
    $(SourceDir)\XX\XX_CommonMethods
    Active
    $/*****/Development/XXirect/XXirect
    (Had added to go directly after the .proj file instead of the .SLN
    $(SourceDir) (NOTE THE XXIRECT WAS NOT ADDED)

    Process

    • Items to Build
      • Here I switched to point directly to the XXirect *.*proj (Note - this was the attempt to fix it do not follow this)
    • Also another gotcha is Configurations to Build -AnyCPU|Dev (Note the AnyCPU sometimes has a spaceAny CPU, note the space) which can causes an issue. GOTCHA look out for that.
    Result - It was building successfully, but the DLL for the CI_CommonMethods did not build in the correct directory, which did not pass my build requirements.


    Thankfully, I checked my email and Ahmed posted on MSDN the following change to the Workspace, which fixed the entire problem.
    Status
    Source Control Folder
    Build Agent Folder
    Active
    $/*****/Development/XX/XX_CommonMethods
    $(SourceDir)\XX\XX_CommonMethods
    Active
    $/*****/Development/XXirect
    $(SourceDir)\XXirect

    This also required swtiching the XXIRECT in the Source Control Folder to point to the *.sln and not the *.*proj file as well as switching back the Process to point to the *.sln successfully ran the build.
    KUDOS KUDOS to Ahmed.

    I searched all overt the Web for 8 hours looking and working on this yesterday. Ahmed and MSDN you really came through. Thanks also for David Star on Plural Sight for an awesome tutorial.
    Post a Comment