Thanks for the info.
Personally, I don't consider using COM for .NET applications or putting
all my applications that use a particular library in the same folder
viable options.
I'm not familiar with the "GAC" but will research it further.
As I indicated elsewhere, I can see wanting to stick the library in the
same folder as the application for libraries that receive wide
distribution. But, for in-house stuff, I don't like that approach.
I'll also check out that MS link you provided.
--
Jonathan Wood
SoftCircuits Programming
http://www.softcircuits.com
RE:
<< Either I'd need to put all the applications in the same directory,
or I'd need store multiple copies of the DLL >>
The 3rd option, as others have pointed out, is to install to the GAC
(global assembly cache) - which is intended for such purposes.
If you don't want to go to the GAC, then storing multiple copies of the
DLL would probably be the easiest way to have multiple apps using
[copies of] a particular DLL. If you find the idea of having multiple
copies to be a problem, then whatever those reasons are - they would
likely be addressed by going to the GAC.
So it breaks down like this:
1. "I'm too lazy to install to the GAC" ---> then go with multiple
copies; one per app
2. "I don't want multiple copies because I don't want multiple
versions floating around beyond my knowledge" ---> then go to the GAC
3. Multiple apps in same folder to "share" a DLL is just plain
rediculous.
4. You could revert to COM, but then you get DLL hell again.
5. In your App.config file, use the codebase and/or probing elements
to specify one common assembly location (for your shared DLLs) - see
[
http://msdn2.microsoft.com/en-us/library/4191fzwb(VS.71).aspx] for
more. This might end up being akin to creating your own GAC, with the
additional maintenance and documentation overhead of going outside of
well-known GAC or XCopy deployment options.
Those are pretty much your options.
-S
Carl,
Can anyone point me in the right direction getting started learning
the best way to write a library of routines and then being able to
access those routines from several different .NET applications?
You put them in DLLs. This doesn't result in "DLL Hell" because such
DLLs are then generally deployed "app local" - in the applications
'bin' directory, rather than in some silly place like %systemroot%.
That wouldn't work very well if I was using the lib from several
different applications. Either I'd need to put all the applications in
the same directory, or I'd need store multiple copies of the DLL.