从 TFS build 2010 中的工作流调用编译为 x86 的代码活动
背景
我们需要或至少希望调用第 3 方 DLL,该 DLL 仅在从编译为 x86 的 .Net 程序集调用时才加载/运行。为了兼容性,我们通常将 .Net 程序编译为 x86,因此这在过去不是问题。我正在考虑获得 x64 版本,但看起来前景并不乐观。
真正的问题
当我将代码活动编译为 x86 而不是“任何 CPU”时,构建代理会抛出错误,指出它找不到我们的代码活动。
问题
我需要做一些特别的事情吗 在工作流程中执行以下操作来告诉它代码活动的 程序集是 x86?
我可以强制代码活动运行为 x86,即使它是编译的任何 CPU?
有没有办法强制整体 工作流程以 x86 运行?
Background
We have a need, or at least a desire, to call a 3rd party DLL that will only load/run when called from a .Net assembly compiled as x86. For compatibility we normally compile our .Net programs as x86 anyway so this hasn't been a problem in the past. I'm looking into getting a x64 version, but it doesn't look promising.
The Real Problem
When I compile our Code Activity as x86 instead of "Any CPU" the build agent throws an error stating that it cannot find our code activity.
Questions
Is there something special I need to
do in the work flow to tell it the code activity's
assembly is x86?Can I force a code activity to run as
x86 even if it's compiled Any CPU?Is there a way to force the whole
work flow to run as x86?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
TFS Build 2010 是 64 位,这可能会导致该问题。
但是为什么要将团队构建使用的代码活动编译为 x86 程序集呢?该代码活动是否使用第 3 方 dll?
The TFS Build 2010 is 64 bits which probably causes the problem.
But why do you want to compile your code activity that is consumed by team build as an x86 assembly? Does that code activity using the 3rd party dll?
我们遇到了同样的问题,工作流程中的一个代码活动出于文档目的进行了一些程序集加载和反射(同时在 TFS 2012 中:))。
我们为链接到所有需要的代码活动 cs 文件的命令行 exe 创建了一个小型解决方案。在 exe 中,我们使用如下方式调用活动:
在工作流模板中,我们在构建 x86 时调用 exe,否则对活动进行正常调用。为了调试活动,我们切换到 AnyCPU。
We had the same problem that one code activity in our workflow did some assembly loading and reflection for documentation purposes (meanwhile in TFS 2012 :)).
We have created a small solution for a command line exe linking to all needed code activity cs files. In the exe we call the activity with something like:
In our workflow template we call the exe when we build x86 and do a normal call to the activity otherwise. For debuging the activity we switch to AnyCPU.