Loading Assembly from folder

  • Thread starter Thread starter Jatinder
  • Start date Start date
J

Jatinder

Hi,

I have written dlls in c# that are being used by other applications.

My application works fine if I add these dlls to executable folder,but when
I place these dlls in another folder my application crashes.

Is there any way to load these dlls from folder other than executable folder.

If yes, How will I do that.

I have tried changing manifest file to add dependent assembly but no result.
 
Well, there is always the Global Assembly Cache (GAC) - sounds a
likely place for shared assemblies. Actually, in most cases I prefer
the isolation of an app that just runs within its own subtree (bin
etc)... very easy to deploy / upgrade, without having to worry about
what else is on the machine.

Marc
 
Hi,

I have written dlls in c# that are being used by other applications.

My application works fine if I add these dlls to executable folder,but when
I place these dlls in another folder my application crashes.

Is there any way to load these dlls from folder other than executable folder.

If yes, How will I do that.

I have tried changing manifest file to add dependent assembly but no result.

If the dlls are shared by multiple applications, try using GAC.

otherwise look at Assembly.Load() for dynamically loading the
assemblies, so that you can use the folder structure you want. I need
to find out any other ways of doing it????

-Srinivas
 
Thanks for your reply

These dlls are used by one application.
I have about 30-35 dlls used by this application and I have to make changes
to all these dlls in order to use Assembly.Load() method.

I am looking for other way round to solve this problem

Thanks
Jatinder
 
Back
Top