Microsoft.Office.Interop.Excel reference in the build server

I am using the Microsoft.Office.Interop.Excel link in a windows service application to create excel reports. The application works fine on the DEV machine, but on the build machine it does not respond: "The type or name of the" Office "namespace does not exist in the" Microsoft "namespace (do you have a shortcut to the assembly?)"

It runs on a DEV machine because MS Excel 2010 is already installed. But MS Excel is not installed in the build server.

My question is whether the installation of MS Excel on the assembly server is mandatory for the success of the assembly, or can I copy the Microsoft.Office.Interop.Excel.dll file to my project folders, specify it and register it for assembly. Currently, the dll link added to the application points to the assembly (GAC).

Another thing is that these interop dlls are not redistributed as they are part of the MS_Office product.

Please suggest me the right approach in this regard.

+3
source share
2 answers

You also need to install MS Excel on the build server. Interop DLL cannot function without the presence of Excel itself.

For more information on Office development, you can refer to the official MSDN documentation.

-1
source

As described in http://social.msdn.microsoft.com/Forums/vstudio/en-US/c9e83756-4ae2-4ed4-b154-1537f3bb3a22/cant-find-microsoftofficeinteropexceldll?forum=netfxsetup

In the Project menu, click Add Link.

On the COM tab, select Microsoft Excel Object Library, and then click Select. In Visual Studio 2012, locate the Microsoft Excel 14.0 Object Library (or another version) on the COM tab.

Click OK in the Add Links dialog box to accept your selection. If you are prompted to create a wrapper for your selected libraries, click Yes.

-2
source

Source: https://habr.com/ru/post/1203880/


All Articles