如何引用 PIA 以便我的构建可以在构建服务器上运行
我正在研究一些我继承的东西,它们的项目结构有点混乱。 一些项目引用了希望安装在 GAC 中的主互操作程序集 (PIA)。 解决方案文件夹中有一条注释(摘要)“在构建此项目之前,首先构建 X、Y 和 Z 并手动将它们安装在 GAC 中”。 嗯,这并不真正有利于自动化或持续集成,不是吗?
我想让此构建在 TeamCity 构建服务器上运行,构建代理将在全局程序集缓存 (GAC) 中未安装 PIA 的计算机上运行。 所以构建将会失败。 我不想在每台构建代理机器上安装这些 PIA,我需要构建是独立的,这样它就可以从干净的源代码签出中构建,一应俱全。 所以问题是双重的。
- 如何构建构建,使其自包含并且在对 GAC 存在任何依赖性时也不会中断?
- 如果 (1) 成功,这将如何影响最终用户桌面的部署(PIA 必须安装到 GAC)?
我非常感谢 Stack Overflow 社区的专家建议。
I'm working on some stuff I've inherited that has a slightly untidy project structure. Some of the projects reference a Primary Interop Assembly (PIA) that it expects to be installed in the GAC. There is a note in the solution folder that says (in summary) "Before building this project, first build X, Y and Z and manually install them in the GAC". Well, that's not really conducive to automation or continuous integration, is it?
I want to make this build work on a TeamCity build server, the build agent will run on a machine that doesn't have the PIAs installed in the Global Assembly Cache (GAC). So the build will fail. I don't want to have to install these PIAs on every build agent machine, I need the build to be self-contained, so it can build from a clean source code checkout, soup to nuts. So the question is twofold.
- How can I structure the build so that it is self contained and doesn't break if there are any dependencies on the GAC?
- If (1) is successful, how will this affect deployment to end-user desktops, where the PIAs must be installed to the GAC?
I would appreciate the expert advice of the Stack Overflow community.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我只需添加一个构建步骤,将 X、Y 和 Z 安装到 GAC,然后完成构建、运行单元测试等。
完成后,它会从 GAC 中卸载。
让您的构建“独立”的唯一方法是停止依赖 GAC 安装的程序集。 这不是构建服务器配置问题,而是程序集架构问题。 如果可能的话,仅制作那些在构建时复制到其他项目的 bin 文件夹的常规程序集引用。
这使得最终用户部署变得非常容易 - 您可以利用 Click-Once 部署而无需安装 GAC。
I would simply add a build step that installs X, Y, and Z to the GAC, and then finishes the build, runs unit tests, etc.
After that is complete, it uninstalls from the GAC.
The only way to have your build be 'self-contained' - is to stop depending on GAC installed assemblies. This isn't a build server config issue, it is a assembly architecture issue. If possible make those just regular assembly references that copied to the other project's bin folder when they are built.
That makes things a lot easy for end-user deployment - you can probably take advantage of Click-Once deployment without GAC installs.