Archive for March, 2011

Loading an assembly from a specific directory (i.e. when not in GAC)

March 20, 2011 Leave a comment

C# Post HeaderJust like dynamically loading DLLs with C# – at last!

You do not have to put an assembly that an application must use at runtime in the bin folder of the application. You can put the assembly in any folder on the system, and then you can refer to the assembly at runtime.

My preference – which requires no configuration during installation – is to use method 3; just find your current executable’s folder and calculate a relative path from there – ensuring that, even when the app is copied using a standard file copy, it still works on the new server (shedding any deployment requirements with regard to this). See here:

Categories: C#
%d bloggers like this: