Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

TFS 2010 Microsoft.Office.Interop Reference Woes

I'm about to go crazy with this problem!

  1. I created a new server on a virtual machine for TFS.

  2. I have created a new Build Definition, that when a solution is checked in from my local machine TFS is to build my solution using the default build process template.

  3. On the TFS machine and my local machine I have MS Office 2010 and .Net framework 4.0 Installed.

  4. In my project I have a reference to Microsoft.Office.Interop, etc...

  5. This all build fine on my local machine.

The problem occurs when the build definition is triggered. The build is run and does it's stuff for a while until it gets to the Microsoft assembly references.

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

  • The type or namespace name 'Application' could not be found (are you missing a using directive or an assembly reference?)

  • ETC

The references paths point to the GAC, in case that matters.

Help would be awesome, and you would therefore be awesome by extension.

Regards, Byron Cobb.

like image 424
Bob Avatar asked Dec 22 '22 21:12

Bob


1 Answers

Byron,

If you take the assemblies from the compiled version on your computer create a libs folder at your solution level, then add the dlls for

  1. Microsoft.Office.Interop.Word.dll
  2. Microsoft.Office.Interop.Excel.dll
  3. Microsoft.Vbe.Interop.dll
  4. OFFICE.DLL

Into the libs folder, then remove the reference to your Office Interop and add references to the following assembies in you libs folder, should work a treat, we build without office on our build server.

Regards

Iain

like image 156
Iain Avatar answered Dec 28 '22 11:12

Iain