编译在TFS中具有Microsoft Excel的内部版本 [英] Compiling builds that have Microsoft Excel in TFS

查看:114
本文介绍了编译在TFS中具有Microsoft Excel的内部版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在VB.net 2010中编译使用Microsoft Excel dll的项目.从计算机上编译时,它一切正常,但是当我使用TFS排队新的构建时,出现错误,提示未定义Microsoft.Interop.Excel....我直接在TFS服务器上安装了Microsoft Office 2010,但仍然遇到相同的错误.

I am trying to compile a project in VB.net 2010 that uses Microsoft Excel dll at some points. It works all fine when I compile from my computer, but when I use TFS to queue a new build, I get the error that Microsoft.Interop.Excel... are not defined. I installed Microsoft Office 2010 directly on the TFS server but I still get the same error.

要执行此配置,我必须执行任何配置吗?

Are there any configuration I must perform for this to work?

您将在Build上看到的典型错误消息:

Typical error message you will see on a Build:

错误BC30002:未定义类型'Excel.Worksheet'.

Error BC30002: Type 'Excel.Worksheet' is not defined.

错误BC30002:未定义类型'Microsoft.Office.Interop.Excel.Application'.

Error BC30002: Type 'Microsoft.Office.Interop.Excel.Application' is not defined.

警告BC40056:在导入"Microsoft.Office.Interop"中指定的命名空间或类型不包含任何公共成员,或者找不到.确保定义了名称空间或类型,并且至少包含一个公共成员.确保导入的元素名称不使用任何别名.

Warning BC40056: Namespace or type specified in the Imports 'Microsoft.Office.Interop' doesn't contain any public member or cannot be found. Make sure the namespace or the type is defined and contains at least one public member. Make sure the imported element name doesn't use any aliases.

推荐答案

您需要将dll包含在TFS中保存的lib文件夹中,并从该位置引用该dll,而不是在项目中安装了该dll的任何其他位置

You need to include the dll's in a lib folder that is kept in TFS and reference the dll's from that location, in your project not wherever else they have been installed.

开发人员通常从C:\ Program Files(x86)\ Microsoft Visual Studio 14.0 \ Visual Studio Tools for Office \ PIA \ Office15引用Interop PIA,服务器上将不存在此文件夹.

Developers typically reference the Interop PIA's from C:\Program Files (x86)\Microsoft Visual Studio 14.0\Visual Studio Tools for Office\PIA\Office15 and this folder wont exist on the server.

您需要将这些文件(例如Microsoft.Office.Interop.Excel.dll)复制到源代码管理中的lib或refs文件夹,并从您的解决方案而不是PIA路径中引用这些DLL.

You need to copy these files, eg Microsoft.Office.Interop.Excel.dll to a lib or refs folder in source control and reference these DLLs from your solution instead of the ones in the PIA path.

还请注意,Reference Assemblies文件夹中的DLL也是如此,例如:

Also note, same goes for DLLs from the Reference Assemblies folder, eg:

C:\ Program Files(x86)\参考程序集\ Microsoft \ Framework.NETFramework \ v4.5 \ System.Windows.Forms.dll

C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.5\System.Windows.Forms.dll

这篇关于编译在TFS中具有Microsoft Excel的内部版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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