Assembly redirection during application launch using Reflection

I am trying to launch a windows application App1.exe (based on .Net 1.1) using reflection from another windows application. App1.exe has an associated .exe.config in which I put assembly redirection for few assemblies.
The assembly redirection is working fine when App1 is launched individually.
But when launched using reflection, it is not working. It still expects the original version of assemblies. Is there a way to make it work

Thanks.


Answer this question

Assembly redirection during application launch using Reflection

  • bhavener

    I found a way. I just copied my other assembly's .exe.config file in my host application's directory. It just worked!

    Thanks.

  • newboy

    I experimented this already and found it working. I want to avoid this binding with the host as the .exe.config of original file keeps changing in which case the host .exe config file should be updated as well, which is not possible.

  • JEA

    Hi,

    In that case, add the assembly redirects to the app.config file of the host .EXE file which is using this other assembly - I think that should work...

    Regards,
    Vikram

  • cortega

    I am just thinking if I could link my host .config file with the other assembly's .exe.config file! This way I can accomodate the changes to the source config file.

    Thanks.

  • FilthyZombie

    Hi,

    If you are anyway launching the .EXE, why not use Process.Start()

    You would need to add a strong name and it to GAC and give a publisher policy file for your approach to work correctly.

    Regards,
    Vikram

  • Paul Siu

    Hi,

    This is as per design of the .NET Framework. The assembly hosted within a parent will take the config of the parent process. 

    If you want to have everything in one place, then you would need to move it to machine.config file of the machine on which you are installing - that way its in a single place where u can update.

    Regards,
    Vikram

  • Francis

    I don't want to run it as a separate process as I need to interact with objects present in it using Reflection methods. If it runs as a separate process I need to use Remoting, which I don't want to do so. Is it not possible to get assembly redirection work if it is not in GAC and with no publisher policy

    Thanks.



  • Assembly redirection during application launch using Reflection