How to compile projects that reference Microsoft.Office.Interop assemblies with a build server

The Problem

A project that references Office interop assemblies (Microsoft.Office.Interop) fails to compile on TF Build (or VSO’s Elastic Build Service).

The error message might be similar to this one:

The type or namespace name ‘Office’ does not exist in the namespace ‘Microsoft’ (are you missing an assembly reference?)

The Solution (based on this forum post)

You want to check-in the interop assemblies.

  1. Create a “Lib” folder and add all relevant assemblies, like:
    • Microsoft.Office.Interop.Word.dll
    • Microsoft.Office.Interop.Excel.dll
    • Microsoft.Vbe.Interop.dll
  2. Removed the references to your Office interop assemblies and add references to the assemblies in your libs folder.


Leave a Reply

Your email address will not be published. Required fields are marked *


You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>