Loading Assembly from folder

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.
 
M

Marc Gravell

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
 
D

Duggi

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
 
J

Jatinder

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top