GetApplicationFolder()
{
// This works whether the application is running within ClickOnce, in
// which case it returns something like this:
//
// "...\Some ClickOnce Folder".
//
// ...or in the development environment, in which case it returns
// something like this:
//
// "C:\NodeXL\ExcelTemplate\bin\Debug"
//
return ( Path.GetDirectoryName( GetExecutingAssemblyPath() ) );
}