开发者

How to handle build breaking external dependencies with a Continuous Integration server? (Ex, Crystal Reports with TeamCity)

开发者 https://www.devze.com 2023-01-30 03:49 出处:网络
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.

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 prop开发者_Go百科er 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


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消