试图让TFS teambuild来构建c#> VB6> c#应用程序(ComReference概率?) [英] trying to get TFS teambuild to build c#>VB6>c# application (ComReference prob?)

查看:93
本文介绍了试图让TFS teambuild来构建c#> VB6> c#应用程序(ComReference概率?)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试建立TFS团队,以可靠地构建WPF C#应用程序.此应用程序依赖于我们维护的VB6Lib.dll,此VB6Lib.dll本身依赖于我们也维护的其他C#库.

I'm trying to get TFS team-build to reliably build a WPF C# app. This app relies on a VB6Lib.dll which we maintain, this VB6Lib.dll itself relies on other C# libs that we also maintain.

我已经建立了一个构建定义来构建(按顺序):

I've set up a build definition to build (in order):

  • VbDependencies.sln(此库中的所有库都有com互操作集,因此VB6可以找到它们的TLB)
  • buildVB6Lib.proj(一个名为"VB6.exe/make/d"的msbuild文件,用于在构建服务器上制作VBLib.dll,作为该脚本的一部分,我一直在将VB6Lib.dll输出复制到C: \ tmp)
  • MainApp.sln(在我的工作空间中,我已经添加了对C:\ tmp \ VB6Lib.dll的引用)

听起来不错吗 ? 在我的开发笔记本电脑上,我通常会构建VB6,将其输出复制到\ tmp,然后在其中进行regsvr32,然后再在C#解决方案中添加对它的引用.这是我无法确信我的构建定义正在执行的步骤.

Does this sound ok ? On my dev laptop I usually build the VB6, copy its output to \tmp and then regsvr32 it there before adding a reference to it in my C# solution. It's this step that I'm not convinced my build def is doing.

此外,还有一种方法可以从VB6构建中获得更多有用的输出,当前我收到文件'xxx.bas'可以找到库项目的编译错误",但是找不到它无法找到的实际库

Also, is there a way to get more useful output from the VB6 build, currently I get "Compile Error in File 'xxx.bas' Can' find project of library", but not which actual library it can't find.

欢呼

推荐答案

您是正确的,因为在开发系统上构建过程中的关键点在于注册COM对象.但是,通常不希望在构建服务器上注册COM对象,因为当注册错误的COM对象或注册失败时,这可能导致各种版本控制问题和无提示失败.

You are correct in that the critical point in your build process on the development system lies in registering the COM object. However, one does not in general want to register the COM object on the build server, as this can cause all kinds of versioning issues and silent failures when the wrong COM object is registered or the registration fails.

完成此操作的正确方法是手动生成一个互操作程序集,然后引用该程序集而不是COM对象.这是通过tlbimp实用程序完成的,例如:

The proper way to accomplish this is to generate an interop assembly manually and reference that instead of the COM object. This is accomplished with the tlbimp utility, for instance:

tlbimp ..\Libraries\VBLib.dll /out:..\Libraries\Interop.VBLib.dll

在开发系统上运行该命令,然后删除对VB6Lib.dll的引用并添加对Interop.VBLib.dll的引用.然后,您可以在引用项目中将tlbimp命令添加为预构建事件,以使interop程序集始终从正确的版本进行构建,并且不再需要在构建系统上注册COM对象.

Run that command on your development system, then remove the reference to VB6Lib.dll and add a reference to Interop.VBLib.dll. You can then add the tlbimp command as a prebuild event in the referencing project so that the interop assembly is always build from the correct version, and you will never again need to have your COM object registered on the build system.

这篇关于试图让TFS teambuild来构建c#> VB6> c#应用程序(ComReference概率?)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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