Solved

Sharing DLLs..How to Reference

Posted on 2010-11-24
7
829 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 
LVL 12

Assisted Solution

by:andrewjb
andrewjb earned 100 total points
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
Thanks
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

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…
This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

744 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

9 Experts available now in Live!

Get 1:1 Help Now