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

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

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:

http://support.microsoft.com/kb/837908

Advertisements
Categories: C#
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: