I have this code to load a config file and read all the values and it works fine when running the application but of course fails on team city because the appdomain\'s base
try this one:
Module[] modules = Assembly.GetExecutingAssembly().GetModules(); return Path.GetDirectoryName(modules[0].FullyQualifiedName);