Resolving references in Team Build ( Part 3 )



We have a common project that contains company wide logic that rarely changes and almost every other project references these common assemblies. I don’t want (or need) to build these assemblies with each projects nightly build, but would rather just grab the dlls from a common bin folder. Currently this common bin folder is 'shared' in SourceSafe. This way we only need to update the bin folder instead of having multiple copies for every other solution. Is it a supported scenario in Team Build?


Yes, it is supported in Team build.


Additionally I don't want each build type to rebuild these common assemblies. I want team build to just grab the assemblies from source control. I want different Team Projects to reference the shared/common folder.


Resolving the references directly from source control is not possible. You need to sync the “shared” folder on the build machine. Please make sure that relative path of the references are correct. Also make sure you have the correct versions of assemblies in the common shared folder. You can include the reference for the “shared” folder by editing the build type definition (tfsbuild.proj).  Define a new item of the type "AdditionalReferencePath". Make this item point to the "shared" folder. Please note that post beta 3 there might be a change in the way external references are resolved. If you are using beta 3 bits, apply the fix (mentioned in this post) to file Microsoft.TeamFoundation.Build.targets.


Comments (4)

  1. PF says:

    We are referencing our common dlls from a mapped drive (T:). It appears that adding <AdditionalReferencePath Include="T:Build" /> does not work. Specifying a non-mapped, local path does work.

    Is there a way to resolve the mapped drive (it’s mapped correctly on the build machine)?

    [we’re using the latest release TFS].

  2. PF says:

    Forgot to mention another issue: every project also has a post-build event that copies successfully built dlls to that mapped drive. All those scripts are failing as well (even after resolving the issue decribed above).

  3. Stephen Woolhead says:

    The drive mapping is per profile, are you sure that the drive is mapped into the profile of the user the team build service is running under?  If you can use a UNC path, if the share is going to move from server to server, you can hide this by exposing the share via DFS.

  4. sergey says:

    it seems that post build script is not executed when runing built by Team Build

Skip to main content