tags:

views:

332

answers:

1

I have 10+ apps that are on a single app pool. All these apps have some common dlls that they all load. The issue right now is that these dlls are put in the '\bin' folder for each app. So each app; even though it uses dll_a, will end up loading its own 'copy' of dll_a.

I have a few questions 1) Is this ok? 2) Should i put dll_a in some common folder and have all apps reference 1 single copy? 3. Does each worker process serving these apps load multiple copies of dll_a from different paths even though they are basically the same dll?

+2  A: 

1) Is this ok? -- yes this is ok.

2) Should i put dll_a in some common folder and have all apps reference 1 single copy? -- you can if you want. The problem you will run into is that if you ever need to have an app use a different version of the dll all the others will have to upgrade (or downgrade). If deployment isn't a problem for managing the dlls I would tend to give them their own sererate copy. We have a pretty automated process where I work though, so keeping things in sync when they need to be is pretty trivial here.

3) Does each worker process serving these apps load multiple copies of dll_a from different paths even though they are basically the same dll? -- Yes each process will have it's on copy of the dll. Each application runs in it's own memory space, so althought technically they are using the same one, each one will have a copy of it in memory.

Kevin
So if they all reference a single dll; then the DLL is loaded in memory once and all apps reference it. So if that DLL has 'static' data (variables) in it; then all apps will reference same static data?
shergill
No each dll will reference it's own version of the static data. The memory space each uses is different. If you want to do something like that you'll need something like a remotable application which all call into to access common data.
Kevin