Visual Studio中引用 [英] Visual Studio Referencing

查看:208
本文介绍了Visual Studio中引用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用C#的WinForms,当我增加对 Microsoft.Interop.Office.Excel v12.0.0.0 到项目的引用,它会自动添加一个COM引用到 C:\Program Files\Microsoft Office\Office14\EXCEL.exe

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.

.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?

推荐答案

任何Microsoft Office工具,如微软。 Office.Interof.Excel是微软主互操作程序集叫PIA,它可以单独下载并安装生产机器上的一部分。

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.

PIA的所有版本可以从MSDN下载。例如办公室PIA

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

MSDN皮娅链接

或者你可以在你的解决方案,将它们复制到库文件夹和库文件夹本地解决方案引用这些组件。

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

这篇关于Visual Studio中引用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆