jeudi 14 septembre 2017

How can I trick system.windows.forms.application.startuppath into returning a different directory?

I'm trying to reflect into an installed app. It loads files from it's local folder. I had initially assumed just using Directory.SetCurrentDirectory would work, unfortunately, some of the code in the assembly I'm reflecting into uses system.windows.forms.application.startuppath which ignores the current working directory and loads the dir the running assembly (my code) started from. While I'm aware that what I am asking for is black magic, is there some way to trick that constant into temporarily thinking it's not where my actual app is starting?

Alternatively, as I type this, I'm thinking it might be an x-y problem, can someone think of a better solution than this?





Aucun commentaire:

Enregistrer un commentaire