Solved

Sharing DLLs..How to Reference

Posted on 2010-11-24
7
834 Views
Last Modified: 2012-05-10
I have an application that makes use of a shared dll.  The GAC at first  seems to be the most obvious choice for this shared dll to live. However, various components that reference this dll are spread out accross multiple machines, so it would most likely mean that I would need to gac the shared dll on multple machines as well.

However,if at all possible I would like this dll to physically live in one place only.  Question.... is there a way to have the shared dll physically live at one place on the network and have all portions of the app (from various machines on the network) reference the one dll.  Any help or direction would be greatly appreciated.

Jason
0
Comment
Question by:jazzcatone
7 Comments
 
LVL 52

Accepted Solution

by:
Carl Tawn earned 100 total points
ID: 34208299
Option 2 in the following link should help:

    http://support.microsoft.com/kb/897297/
0
 
LVL 29

Assisted Solution

by:Nightman
Nightman earned 100 total points
ID: 34208528
What does the .dll do? Is there any reason that you don't simply distribute a copy of it with each application?

Advantages:
1. You only need to update the applications that require the new assembly, meaning you CAN modify the interface without recompiling the dependant applications.
2. You will not inadvertantly break ALL dependant applications (those with the previous version will simply continue to use it)

Disadvantages:
1. You have to remember to update a new version on all machines and in all locations (although this CAN be automated with installers or simply xcopy distrubution)

If you really want it to live in a single location, what about exposing it as a web service on your lan?
Advantages:
1. Single location for all updates
2. Bug fixes/updates are applied to all consuming clients

Disadvantages:
1. Single point of failure
2. Upgrading requires that you maintain backward compatibility with all connected clients.
3. Possible latency issues  - using self-hosted wcf service (i.e. no IIS) with nettcp bindings instead  of http would reduce this.

What works for you?
0
 
LVL 13

Assisted Solution

by:iHadi
iHadi earned 100 total points
ID: 34208653
There are 3 ways to do it, although I do not like the idea of sharing a dll outside the system's boundaries:

1. using a plugin architecture: This means building and using your dll as a plugin. You can use the MEF framework to do the plugin logic for you and load a dll you provide it's path. This path can be a network path or network disk.

2. Reference your dll as usual in your project, then modify the app.config file of your application to tell it to look for references not only in the bin directory, but in other directories you specify.

3. Write a simple method in your app main that checks the version of the current dll before loading it, and replaces the dll from a specific shared directory if the dll is outdated, or a new version is available.
0
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 
LVL 12

Assisted Solution

by:andrewjb
andrewjb earned 100 total points
ID: 34211783
I don't know about the details and all the issues, but...

Windows 7 / Vista may well fail with security issues if you try to reference and load a dll that's on a network share. - try a simple test app before you go the whole hog, and make sure you test outside of Studio, on a release build, on a 7/vista machine.
0
 
LVL 13

Expert Comment

by:iHadi
ID: 34212289
Yes, Referencing dlls from network shares might fail or might not, depending on the .net framework code access security policy (cas). CAS is a .net feature and can be configured in the control panel -> administrative tools or using caspol.exe.

So if you choose to go with referencing on network shares, you might need to do some changes in the Cas policy panel.
0
 
LVL 2

Assisted Solution

by:Ray_Adams
Ray_Adams earned 100 total points
ID: 34216591
Its wise to try Publish Wizzard and publish your application on server. Client will run and install them from local intranet. This method will helps you to be sure that your updated version of .dll or even .exe will be always used any users in network.
0
 

Author Closing Comment

by:jazzcatone
ID: 34232509
Thanks
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now