微软构建与Cruise Control - 将项目中的引用从 32 位版本替换为 64 位版本

发布于 2024-08-04 02:14:09 字数 700 浏览 2 评论 0原文

我有一个解决方案,其中包含一个项目,该项目引用了创建 PDF 文件的库。 PDF 库有 32 位版本和 64 位版本。在开发过程中,该项目引用了32位版本。

我正在 32 位机器上进行开发。每当我将某些内容检查到源代码管理中时,我都会让 Cruise Control 触发构建。构建服务器是一台 32 位机器。

不幸的是,代码还必须部署到 64 位机器上。我的所有代码都在 64 位计算机上进行管理并运行良好,因此正是这个 PDF 库导致了问题。

我想我需要创建一个 Cruise Control 项目,该项目在签入时打开项目文件,将 32 位 PDF DLL 的引用替换为对 64 位版本的引用,然后执行构建(创建一个准备就绪的构建) 64 位机器)。

有人对执行此操作的最佳方法有任何建议吗?我最初的计划是创建一个预构建步骤,例如:

[预构建] [执行] [baseDirectory]E:\Dev\CommonCode[/baseDirectory] [可执行文件]Replace32DllWith64Dll.cmd[/可执行文件] [/执行] [/prebuild]

它运行一个 .cmd 文件来进行替换,但我不知道如何将 cmd 文件放在一起,并且不确定这是否会起作用...也许有一种更标准的方法来执行此操作之类的东西?

任何指示将不胜感激......

谢谢,

保罗

I have a solution which contains a project with a reference to a library that creates PDF files. The PDF library has a 32 bit version and a 64 bit version. During development, the project references the 32 bit version.

I am developing on a 32 bit machine. I have Cruise Control triggering a build every time I check something into my source control. The build server is a 32 bit machine.

Unfortunately, the code also has to be deployed to 64 bit machines. All of my code is managed and runs fine on the 64 bit machines, so it is just this PDF library that is causing a problem.

I think I need to create a Cruise Control project, which, on check in, opens the project file, replaces the reference to the 32 bit PDF DLL with a reference to the 64 bit version, then performs a build (Creating a build ready for a 64 bit machine).

Does anyone have any advice on the best way to go about doing this? My initial plan was to create a prebuild step, something like:

[prebuild]
[exec]
[baseDirectory]E:\Dev\CommonCode[/baseDirectory]
[executable]Replace32DllWith64Dll.cmd[/executable]
[/exec]
[/prebuild]

Which runs a .cmd file to do the replace, but I have no idea how to put the cmd file together, and am not sure if this would work anyway... Perhaps there is a more standard way for doing this sort of thing?

Any pointers would be much appreciated...

Thanks,

Paul

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

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

发布评论

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

评论(1

娇柔作态 2024-08-11 02:14:09

好的,成功解决了这个小难题:

基本上,我创建了一个快速但肮脏的 VBScript,它只是打开我的项目文件,并用 64 位 DLL 的路径替换 32 位 DLL 引用的路径。我使用批处理文件来触发 VBScript。

然后,我更新了 Cruise Control 配置文件,以告诉构建过程在 MSBuild 开始工作之前执行批处理文件。

似乎对我来说效果很好...

完整的文章包含更多详细信息和实际脚本:

http://webpangea.blogspot.com/2009/09/cruise-control-with-msbuild-switching.html

希望它对某人有帮助。

保罗

Ok, managed to solve this little conundrum:

Basically I created a quick and dirty VBScript which simply opens my project files, and replaces paths to the 32 bit DLL reference with paths to the 64 bit DLLs. I used a batch file to fire the VBScript.

I then updated the Cruise Control config file to tell the build process to execute the batch file, just before MSBuild does it's work.

Seemed to work well for me...

A full write up with further details and the actual scripts is available:

http://webpangea.blogspot.com/2009/09/cruise-control-with-msbuild-switching.html

Hope it helps someone.

Paul

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