?
Solved

Sharing DLLs..How to Reference

Posted on 2010-11-24
7
Medium Priority
?
862 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 400 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 400 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 400 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
NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

 
LVL 12

Assisted Solution

by:andrewjb
andrewjb earned 400 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 400 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

NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

Question has a verified solution.

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

Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…

752 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