Visual Studio Referencing

房东的猫 提交于 2019-12-10 19:26:50

问题


I am using C# Winforms and when I add a reference to the project for Microsoft.Interop.Office.Excel v12.0.0.0, it automatically adds a COM reference to C:\Program Files\Microsoft Office\Office14\EXCEL.exe.

This .exe isn't found on any other machines, and as such, it won't work on other devices. Is there a way to import that file, or make it not reference to that file?


回答1:


Any microsoft office tools like Microsoft.Office.Interof.Excel are part of Microsoft Primary Interop Assemblies called PIA, which can be downloaded separately and installed on production machine.

All version of PIAs can be downloaded from msdn. e.g. Office PIA

Msdn Pia link

Or you can copy them to Library Folder in your solution and reference these assembly from Library folder local to your solution.



来源:https://stackoverflow.com/questions/23761249/visual-studio-referencing

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