Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Sharing DLLs..How to Reference

Posted on 2010-11-24
7
Medium Priority
?
868 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
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 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…

618 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