So I have made an updater for my application. It downloads my application (a .dll file) tp %appdata%/Folder
and opens it via reflection like this:
var appdataFolder =
Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + @"\[ApplicationName]\";
var mainAssembly = Assembly.LoadFrom(appdataFolder + @"TF2Callout.dll");
mainAssembly.GetType("TF2Callout.App").GetMethod("Main").Invoke(null, null);
This opens the .dll
and executes the static void Main. But in my application I have this:
Assembly.LoadFrom("SomeOtherDll.dll");
I would expect the application to search for the .dll in the %appdata%/[application name]
folder because it is saved there, however, it tries to find the file in the folder of the installer, which is in my program files.
How would I go about fixing this? I would rather not make the SomeOtherDll.dll
get loaded from an absolute path, because it might change.