How Tridion Content Delivery loads configuration files (.NET)

I got a question recently about how the .NET version of Tridion Content Delivery figures out where your configuration files are located.

As I didn’t know all of the details, I decided to investigate and share my findings here.

In Tridion  2011 SP1, it looks for configuration and JAR files under the following folders (listed in order):

  1. The bin directory from the current web context (e.g. Server.MapPath(“~/bin”)). This is only used if there is an HttpContext available (e.g. running within a web site).
  2. The current directory, as returned by Environment.CurrentDirectory.
  3. The TRIDION_HOME registry value (HKLM\Software\Tridion\Content Delivery\General)
  4. The TRIDION_HOME environment variable.
  5. The default Tridion installation folder (C:\Program Files\Tridion)
For each of them, it checks if it constitutes a valid “Tridion home” directory before moving on to the next. The location is considered valid if:
  • The directory exists.
  • It has a lib subfolder containing the CD JAR files such as cd_core.jar and cd_model.jar.
  • It has a config subfolder containing the CD configuration files such as cd_broker_conf.xml or cd_storage_conf.xml.

You can tell which location it has settled on by looking for “Content Delivery.NET” events in the “Tridion Content Manager” Event Log. You will see a message such as “Using HttpContext current bin directory as Tridion Home”.

That’s it! A mystery no longer…

4 thoughts on “How Tridion Content Delivery loads configuration files (.NET)

  1. Pingback: Blogging on tridiondeveloper.com « Peter Kjaer (SDL)

  2. Thanks Peter, this will definitely help make my next CD install that much easier.

    I found one quick way to check the TRIDION_HOME environment variable is to literally use it in a DOS prompt. Run CMD then do > CD %TRIDION_HOME%. (where this “CD” has nothing to do with that “CD”) :-)

  3. One quick question, does this rule also applies to WCF service which is deployed in the IIS. I meaning first looked into service bin folder and then looked furhter if not found.

  4. The rules are always applied, regardless of the context.

    However, WCF services do not have an HttpContext so the first step would be skipped.
    You could use any of the other steps to get it to load configuration specific to your service (e.g. current directory).

    Sorry for the late reply – I’ve been on vacation for 2 weeks :)

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>