Click here to Skip to main content
15,923,197 members
Home / Discussions / C#
   

C#

 
AnswerRe: Threaded server client two way communication problems and best practises Pin
PIEBALDconsult5-Oct-10 3:04
mvePIEBALDconsult5-Oct-10 3:04 
GeneralRe: Threaded server client two way communication problems and best practises Pin
teknolog1235-Oct-10 3:36
teknolog1235-Oct-10 3:36 
GeneralRe: Threaded server client two way communication problems and best practises Pin
PIEBALDconsult5-Oct-10 15:08
mvePIEBALDconsult5-Oct-10 15:08 
QuestionXML File problem Pin
InderK5-Oct-10 1:22
InderK5-Oct-10 1:22 
QuestionHow to identify is a certificate is in a smart card? Pin
Sunil P V4-Oct-10 22:38
Sunil P V4-Oct-10 22:38 
AnswerRe: How to identify is a certificate is in a smart card? Pin
Rajesh Anuhya4-Oct-10 23:28
professionalRajesh Anuhya4-Oct-10 23:28 
AnswerRe: How to identify is a certificate is in a smart card? Pin
Goutam Patra5-Oct-10 2:15
professionalGoutam Patra5-Oct-10 2:15 
QuestionB.K.M for dynamically resolve assembly location - a question [modified] Pin
Shultz 24-Oct-10 20:57
Shultz 24-Oct-10 20:57 
Hi all
Your help\opinion is required on a bothering subject I am debating with for a long time...

Tools: .NET 2.0, VS2005. C#

The story:
I am designing a platform that uses plugins (written by her users) and does something with them.
The plugins are mainly dll file(s) that implement some declared interface.
My platform architecture is as such:
The platform sits at certain directory (say c:\PlatformBin).
The plugins sits in user defined location (say c:\UserPlugins)
Upon starting the platform, it accepts at run time (registry key) the plugins directory, traverse and instantiate all plugins resides there.

The problem:
User plugin is eventually a dll, that implements given interface (say UserPluginDll.dll). This dll can use, if\as needed, other external dll's that needs to be in the same directory. (say User3rdPartyDll.dll)
When the platform loads the plugins, it explicitly loads the UserPluginDll.dll file (through Assembly.LoadFile(UserPluginDll.dll);). This works fine.
The problem happens when the platform actually access at runtime to the user code in the plugin, that uses the user 3rd party dll (User3rdPartyDll.dll)
The CLR can't find the relevant User3rdPartyDll.dll file and raises up an exception "file not found...").

The suggested solutions:
Here are some tricks and solutions that I have tried\disqualified:
1. Use GAC (not an option)
2. Add to the appDomain private bin path for the c:\UserPlugins directory (and its subdirectories) - not working since private bin path (and other similar tricks) is always relatively to the app bin path (c:\PlatformBin), and I don't want to create this unnecessary coupling between the users plugins directory and the platform bin directory
3. Use <Probing> element in application config file - not good (and not working as well from some reason), since the plugins directory is learnt at runtime and I don't want the user to go and edit the app config file and change the plugins directory there.
4. Use AppDomain.CurrentDomain.AssemblyResolve += CurrentDomain_AssemblyResolve method, that is raised exactly when the CLR fails to locate the necessary dll.

Summary and question:
I think I will use this forth option eventually, but it also demonstrates a compromise from my side, as it means that the CLR first have to fail and then request my help (at runtime), instead of automatically allows me to tell him at the very first beginning were else he needs to search for its missing dlls at runtime.
I would have expect that CLR will allow me to add additional search paths for searching dll's at runtime, and it drives me crazy that I can't do so !!!

Any one can help ? have other suggestions ?



-- Modified Tuesday, October 5, 2010 3:32 AM
AnswerRe: B.K.M for dynamically resolve assembly location - a question Pin
Mycroft Holmes4-Oct-10 22:00
professionalMycroft Holmes4-Oct-10 22:00 
GeneralRe: B.K.M for dynamically resolve assembly location - a question Pin
Shultz 24-Oct-10 23:18
Shultz 24-Oct-10 23:18 
AnswerRe: B.K.M for dynamically resolve assembly location - a question Pin
Bernhard Hiller4-Oct-10 22:25
Bernhard Hiller4-Oct-10 22:25 
GeneralRe: B.K.M for dynamically resolve assembly location - a question Pin
Shultz 24-Oct-10 23:12
Shultz 24-Oct-10 23:12 
AnswerRe: B.K.M for dynamically resolve assembly location - a question Pin
PIEBALDconsult5-Oct-10 3:07
mvePIEBALDconsult5-Oct-10 3:07 
GeneralRe: B.K.M for dynamically resolve assembly location - a question Pin
Shultz 25-Oct-10 4:59
Shultz 25-Oct-10 4:59 
GeneralRe: B.K.M for dynamically resolve assembly location - a question Pin
PIEBALDconsult5-Oct-10 15:08
mvePIEBALDconsult5-Oct-10 15:08 
QuestionWebpage is fully loaded Pin
wenlong884-Oct-10 20:08
wenlong884-Oct-10 20:08 
AnswerRe: Webpage is fully loaded Pin
rah_sin4-Oct-10 20:31
professionalrah_sin4-Oct-10 20:31 
GeneralRe: Webpage is fully loaded Pin
wenlong884-Oct-10 21:07
wenlong884-Oct-10 21:07 
GeneralRe: Webpage is fully loaded Pin
wenlong884-Oct-10 21:08
wenlong884-Oct-10 21:08 
GeneralRe: Webpage is fully loaded Pin
Pete O'Hanlon4-Oct-10 21:35
mvePete O'Hanlon4-Oct-10 21:35 
GeneralRe: Webpage is fully loaded Pin
Mycroft Holmes4-Oct-10 21:52
professionalMycroft Holmes4-Oct-10 21:52 
GeneralRe: Webpage is fully loaded Pin
Pete O'Hanlon4-Oct-10 22:06
mvePete O'Hanlon4-Oct-10 22:06 
QuestionHow do I get this page? Pin
gemeite4-Oct-10 17:44
gemeite4-Oct-10 17:44 
AnswerRe: How do I get this page? Pin
Eduard Keilholz4-Oct-10 19:49
Eduard Keilholz4-Oct-10 19:49 
GeneralRe: How do I get this page? Pin
gemeite6-Oct-10 15:40
gemeite6-Oct-10 15:40 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.