Is it necessary for the build machine to have Microsoft Office 2007 installed?

旧时模样 提交于 2019-12-18 04:46:11

问题


Our app added functionality to allow users to import certain information from an excel spreadsheet (all users will have Office 2007 already).

The development machine has Office 2007 and the developer added a reference to Microsoft.Office.Interop.Excel - all was good.

However, the build machine does not have Office 2007 installed. When the build is run on the build machine, we get the following build error: "The type or namespace name 'Office' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?)"

I did download the Office 2007 Primary Interop Assemblies redistributable. But when I run that msi on the build machine, I get a messagebox saying "Please Install Microsoft Office 2007 before installing this product"

Is it really necessary to install Office 2007 on the build machine? Is there some other way around this?


回答1:


Make sure the Microsoft.Office.Interop.Excel assembly is checked-in with the source code and the VS project is referencing it from the source tree and not from GAC.

After that is done, surely you do not need MS Office to be installed on the build machine, but you would need it for the application to run.




回答2:


Just ask your devs to check all dll dependencies. This is a clear case of "it works on my machine" where you need to drag the devs to the machine where it is not working and point out that their documentation is lacking in the "dependencies department". If you have access to the source code or can run ILSpy on the assemblies you can propably track this down yourselve.

Safe bet is that yo just install Excel, but this is hitting the problem with a sledge hammer. Your devs SHOULD know what is really needed.....




回答3:


Yes, you must have Excel installed on all machines you want to run your app on.



来源:https://stackoverflow.com/questions/9317488/is-it-necessary-for-the-build-machine-to-have-microsoft-office-2007-installed

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!