Microsoft Office PIA 以及如何从 WebApp 正确引用和构建

发布于 2024-07-10 18:47:20 字数 230 浏览 7 评论 0原文

我目前正在尝试在 TeamCity 上构建,它使用 Microsoft.Office.Interop dll。 当我安装了 Office 时,这将在本地构建并正常工作,但是当尝试在 TeamCity 上构建它时,它会失败,因为它没有引用。

我无法安装 PIA 分发版,因为收到一条错误消息,指出需要安装 Office 2003。 我不想在服务器上安装 Office。

有什么办法可以解决这个问题吗?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

计㈡愣 2024-07-17 18:47:20

如果 teamcity 服务器所做的只是构建,则将 Microsoft.Office.Interop DLL 添加到项目的引用文件夹中,然后将项目配置为在该引用文件夹中查找。

但是,如果 TeamCity 服务器也在运行使用 Office Interop 的测试,那么除非在运行测试的计算机上安装了 Office,否则您将遇到问题。

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.

玩心态 2024-07-17 18:47:20

事实并非如此 - Interop dll 只是 .NET 代码和实际 (COM) Office 代码之间的一个 thunk 层。 如果您的 Interop dll 没有底层 Office dll,则对 Interop 的任何调用都将失败,因为 Interop 将要调用它使之可互操作的 COM 对象。

这些 COM 对象是 Office 对象,因此您需要安装 Office 的某些部分。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文