 <pre><code>AppDomain.CurrentDomain.SetData("DataDirectory", Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)); </code></pre> <p>This should work always because Directory.GetCurrentDirectory() may return other directory than the executable one</p>