Aşağıdaki kod 
bu adresten.
static public string AssemblyDirectory {
     get
     {
         string codeBase = Assembly.GetExecutingAssembly().CodeBase;
         UriBuilder uri = new UriBuilder(codeBase);
         string path = Uri.UnescapeDataString(uri.Path);
         return Path.GetDirectoryName(path);
     } 
} 
Ya da:
//get the full location of the assembly with DaoTests in it
string fullPath = System.Reflection.Assembly.GetAssembly(typeof(DAL)).Location;
//get the folder that's in
string theDirectory = Path.GetDirectoryName(fullPath);
Bu koda bende bunları ekleyeyim: