/* * Created by vincent.tollu@gmail.com * IDE: SharpDevelop * Distributed under the GPL */ using System.Reflection; string CurrDirectory = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); //the above method is broken in some contexts (NUnit test for example), so it's better to use //this one string codeBase = Assembly.GetExecutingAssembly().CodeBase; UriBuilder uri = new UriBuilder(codeBase); string path = Uri.UnescapeDataString(uri.Path); Path.GetDirectoryName(path);