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
Your question is a bit unclear. I don't really know if this is what you want.
I typically use AppDomain.CurrentDomain.BaseDirectory
AppDomain.CurrentDomain.BaseDirectory
Alternatives
Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)
Environment.CurrentDirectory