I would suggest adding the directory path to the env PATH variable at runtime using the following code:
var dllDirectory = @"C:/some/path"; Environment.SetEnvironmentVariable("PATH", Environment.GetEnvironmentVariable("PATH") + ";" + dllDirectory);
Thus, the change only affects the current process and is discarded when it exits.
Tomek Jul 10 2018-12-12T00: 00Z
source share