private void CreateExeMap ()
{
if (exeMapCurrent == null) {
CreateUserConfigPath ();
// current version
exeMapCurrent = new ExeConfigurationFileMap ();
// exeMapCurrent.ExeConfigFilename = System.Windows.Forms.Application.ExecutablePath + ".config";
Assembly entry = Assembly.GetEntryAssembly () ?? Assembly.GetExecutingAssembly ();
exeMapCurrent.ExeConfigFilename = entry.Location + ".config";
exeMapCurrent.LocalUserConfigFilename = UserLocalFullPath;
exeMapCurrent.RoamingUserConfigFilename = UserRoamingFullPath;
if (webConfigurationFileMapType != null && typeof (ConfigurationFileMap).IsAssignableFrom (webConfigurationFileMapType)) {
try {
ConfigurationFileMap cfgFileMap = Activator.CreateInstance (webConfigurationFileMapType) as ConfigurationFileMap;
if (cfgFileMap != null) {
string fpath = cfgFileMap.MachineConfigFilename;
if (!String.IsNullOrEmpty (fpath))
exeMapCurrent.ExeConfigFilename = fpath;
}
} catch {
// ignore
}
}
// previous version
if ((PrevUserLocalFullPath != "") && (PrevUserRoamingFullPath != ""))
{
exeMapPrev = new ExeConfigurationFileMap();
// exeMapPrev.ExeConfigFilename = System.Windows.Forms.Application.ExecutablePath + ".config";
exeMapPrev.ExeConfigFilename = entry.Location + ".config";
exeMapPrev.LocalUserConfigFilename = PrevUserLocalFullPath;
exeMapPrev.RoamingUserConfigFilename = PrevUserRoamingFullPath;
}
}
}