Search code examples
tfswixwixlib

Using wixlibs from another solution with TFS builds


We have installers referencing a wixlib file to get some common functionality. The wixlib is built in another solution then moved to a folder within that solution. When we try to build the installers with a TFS build, we get an error from light.exe:

light.exe: The system cannot find the file '..\..\..\Core\Common\assemblies\v1.0\Common.Wix.wixlib' with type 'Source'.

Our regular projects can reference \assembiles\v1.0, since we have some other common assemblies stored there. How do we get WiX to recognize this location during build?


Solution

  • Since the shared component and the active solution are in two separate projects in TFS, the workspace must be setup so that the relative paths for references remain intact. The easiest way to do this is to set your Build Agent Folder structure in Workspace in your TFS Build to have $(SourceDir) represent your root. However, don't change your Source Control Folder - that stays the same.

    For example, say you have the following structure:

    -TFS
    |-SharedComponents
    ||-MyComponents
    |-ProjectArea
    ||-MyProject
    

    You would want to have the following two items in the build Workspace:

    Source Control Folder               Build Agent Folder
    ---------------------------------------------------------------------------------
    $/ProjectArea/MyProject             $(SourceDir)\ProjectArea\MyProject
    $/SharedComponents/MyComponents     $(SourceDir)\SharedComponents\MyComponents
    

    This mimics the structure in TFS in your build folder, thus allowing all relative paths to remain intact.

    One more note about this configuration: Since you have the shared components in another location, you may want to create a solution folder in MyProject and add the components that you are using to it. This will ensure they get pulled automatically when anyone loads your project from TFS - they won't have to go back and pull down the share components folder separately after discovering a build error.