如何使用持续集成服务器处理构建破坏外部依赖关系? (例如,Crystal Reports 与 TeamCity)

发布于 2024-10-07 13:32:45 字数 423 浏览 3 评论 0原文

我刚开始使用持续集成,并决定使用 TeamCity。我遇到的一个问题是,由于缺少依赖项,我的代码无法编译。

(8, 7): 错误 CS0246: 找不到类型或命名空间名称“CrystalDecisions”(您是否缺少 using 指令或程序集引用?)

所以,我不太确定什么是在这里做的正确的事情。

  1. 我要安装水晶报表吗 可重新分发并让它永远放在那里?
  2. 我是否设置了我的 构建以便安装 Crystal 编译前的报告 所有测试完成后卸载 完全的?
  3. 其他一些选择我 不知道吗?

选项(1)似乎可能是一个问题,因为我可能有多个项目需要不同版本的 Crystal Reports,而且也许我无法将它们全部安装。选项(2)似乎可以通过命令行实现。我猜这是执行此操作的正常方法?

谢谢

I'm new to using continuous integration and have decided to go with TeamCity. One issue I have is that my code is not compiling due to a missing dependency.

(8, 7): error CS0246: The type or namespace name 'CrystalDecisions' could not be found (are you missing a using directive or an assembly reference?)

So, I'm not quite sure what is the proper thing to do here.

  1. Do I install the Crystal Reports
    redistributable and just let it sit there forever?
  2. Do I set up my
    build so that it installs Crystal
    Reports before compiling and
    uninstalls after all the tests are
    complete?
  3. Some other option I
    don't know about?

Option (1) seems like it might be an issue since I could have multiple projects that need different versions of Crystal Reports and perhaps I can't have them all installed. Option (2) seems like it might be possible through the command line. I'm guessing this is the normal way to do this?

Thanks

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

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

发布评论

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

评论(1

醉生梦死 2024-10-14 13:32:45

为了简洁地回答您的问题,您应该在每个需要编译代码库的机器上安装可再发行组件,包括 TeamCity 构建代理,并无限期地将其保留在那里(从那时起,您应该只需要再次触摸该包即可更新它)根据您的应用程序可能需要更新到更高版本)。

通常,需要使用简单的开发环境和/或软件安装来设置 TeamCity 服务器(和/或其构建代理,如果使用分布式 CI 模型)。换句话说,构建代理将需要与开发环境编译应用程序所需的相同资源,除了完全安装 IDE(您可能正在使用 msbuild 或 nant),原因完全相同开发环境需要资源。这些资源包括但不限于:

  • 代码库本身;所有源代码、配置文件和内容/嵌入资源文件。
  • .NET Framework 的目标版本,以及您希望显式支持的任何其他版本(例如,当您以 4.0 为目标时,为 3.5)
  • 外部库,例如 ORM 和 IoC 框架、NUnit、自定义数据提供程序(例如 SqLite),以及可再发行组件,例如如水晶报表。这包括必要时进行 GAC 注册。
  • 输入、输出、程序集引用等的正确文件夹结构与开发环境相同。

确保这一切都存在的最简单方法是尽可能将其构建到您的解决方案架构中。

To answer your question succinctly, you should install the redistributable on every box that is expected to compile the codebase, including TeamCity build agents, and leave it there indefinitely (you should, from that point, only have to touch that package again to update it to a later version as your application may require).

Usually, the TeamCity server (and/or its build agents if using a distributed CI model) needs to be set up with a simplistic development environment and/or an installation of the software. Put another way, the build agent will need the same resources that the dev environment would need in order to compile the application, except for a full install of the IDE (you're probably using msbuild or nant instead), for exactly the same reasons that the dev environment needs the resources. Such resources include, but are not limited to:

  • The codebase itself; all source code, config files and content/embedded resource files.
  • The targeted version of the .NET Framework, and any other version you wish to support explicitly (such as 3.5 when you target 4.0)
  • External libraries such as ORM and IoC frameworks, NUnit, custom data providers such as SqLite, and yes, redistributables such as Crystal Reports. This includes GAC registration as necessary.
  • Proper folder structure for inputs, outputs, assembly references, etc. identical to the dev environment.

The easiest way to ensure this is all present is to build it into your solution architecture where possible.

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