• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1015
  • Last Modified:

app.config file name isn't the same as the exe name when AppDomain.CreateDomain is called

I am using a custom form of the AppUpdater component to do updates to a smart client I am developing.

I am using the AppStart.exe practically unmodified.  This exe is a bootstrap exe which launches my smartclient windows exe (written in C#) using AppDomain.CreateDomain to launch the smart client exe.  The relevant code is:

string AppExePath = (path to the smartclient exe, which is in a subdirectory of the appstart.exe file);

AppDomain NewDomain = AppDomain.CreateDomain (
      "New App Domain",
      AppDomain.CurrentDomain.Evidence,
      Path.GetDirectoryName(AppExePath)+@"\",
      "",
      false);

retValue = NewDomain.ExecuteAssembly(AppExePath,AppDomain.CurrentDomain.Evidence,cmdLineArgs);


This all works fine except for my smartclient exe doesn't look in it's own app.exe.config file when I call ConfigurationSettings.AppSettings["key"] instead it looks for a config file named after the bootstrap exe.  in this case, if I copy the appstart.exe.config file into the same directory as the smartclient exe (which is in a subdirectory of appstart.exe) then it looks in there.  Is there a way to either start the smartclient assembly correctly so that it looks in its own app.config file or to during runtime specify the location & name of the config file to use?
0
datajive
Asked:
datajive
1 Solution
 
testnCommented:
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now