Compactになると、http://www.atmarkit.co.jp/fdotnet/dotnettips/016exepath/exepath.htmlにて触れられているような方法は使えない。
Module[] modules = System.Reflection.Assembly.GetExecutingAssembly().GetModules();
foreach (Module m in modules) {
sProgramPath = m.FullyQualifiedName;
}
sProgramDir = System.IO.Path.GetDirectoryName(sProgramPath);直接GetModules(0)では取得できないのでこんな手を使っている。