views:

522

answers:

2

All,

I am currently trying to build on teamcity, which uses Microsoft.Office.Interop dll. This will build and work fine locally as I have office installed, however when trying to build it on TeamCity it fails as it has no reference.

I can't install the PIA distributable as I get an error message saying the Office 2003 is required to be installed. I don't want to install office on the server.

Is there any way to get around this?

Thanks

A: 

Not really - the Interop dll is only a thunk layer between your .NET code and the actual (COM) Office code. If you have the Interop dll without the underlying Office dll, then any calls into the Interop will fail because the Interop will want to call the COM objects it's making interoperable.

Those COM objects are Office objects, so you will need some part of Office installed.

Richard Gadsden
hello Richard,Are there any way to install Excel without installing it? I mean, register Excel in Com+ to allow .net access to excel files.Thanks.
Josemalive
@josemalive Interop.Excel calls directly into excel.exe, so you would pretty much have to install Excel proper.You might be able to do something with Excel Server, but I don't know enough about that to be able to help you.
Richard Gadsden
A: 

If all the teamcity server is doing is a build, then add the Microsoft.Office.Interop DLL to a References folder for your project, and then configure your project to look in that references folder.

However, if the TeamCity server is also running tests that use Office Interop, then you will run into problems unless you have Office installed on the machine running the tests.

Yuliy