locked
How launched EXE use it's own configuration settings? (Reflection) RRS feed

  • Question

  • Hi All,

    I am using reflection to run an EXE file from my application.

    But the Launched EXE using the appsettings of my application.

    How it'll use the configuration settings from EXE configuration file.

    Thanks in advance.

    • Moved by Min Zhu Tuesday, October 5, 2010 1:44 AM (From:Windows Presentation Foundation (WPF))
    Wednesday, September 29, 2010 9:19 AM

All replies

  • how about launch that 2nd exe through system.diagnostic.process ?
    Wednesday, September 29, 2010 9:24 AM
  • Yes.

    I am running another application.

    I am using Assembly.Load method and using InvokeMember call methods of EXE and run application.

    Wednesday, September 29, 2010 9:29 AM
  • Hi,

    i got the answer.

    See this:

    http://msdn.microsoft.com/en-us/library/system.configuration.configurationmanager.openmappedexeconfiguration%28VS.80%29.aspx

    but i am unable to get the current executing exe path, i have tried but all methods giving my parent application debug folder path.

    I don't want to hard code it.

    Can anybody have any idea.

    Wednesday, September 29, 2010 12:05 PM
  • Hey anybody have any idea, how i get my executing EXE path dynamically?
    Thursday, September 30, 2010 8:56 AM
  • Hi Anuj Pratap SIngh,

    I might be missing something here, but isn't the debug folder where the EXE launched?

    Best regards,

    Min


    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
    Friday, October 1, 2010 8:37 AM
  • EXE is in the Debug folder but in the child application debug folder.

    If i getting path of current executing assembly from child application, it'll returning the parent application debug folder path.

    I need the path of launched EXE to get app.config file from that location.

    This is the problem.


    Monday, October 4, 2010 10:49 AM
  • anybody have answer?????
    Monday, October 4, 2010 6:05 PM
  • Hi Anuj Pratap SIngh,

    I am moving this thread to Off-Topic forum since this question is not technically related to WPF.

    You might get a better and quick support for this question at C sharp language forum or Visual Basic forum.

    Best regards,

    Min


    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
    Tuesday, October 5, 2010 1:43 AM
  • i dunno whether the process.start worked for you or not

    you can try lookinto appdomain, create a new one, and run the 2nd app in it.

    Tuesday, October 5, 2010 3:54 AM
  • I am doing the same.

    Creating a separate appdoain to run 2nd application and than unload it.

    Tuesday, October 5, 2010 1:39 PM