Solved

Sharing DLLs..How to Reference

Posted on 2010-11-24
7
856 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…

724 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