Re: Anything Wrong With "preloading" Assemblies?



Hello Robert

i dont see any problems here. The only thing to discuss is the preload instead of load on demand. But that depends on your specific architecture. But i am looking forward to read some other opinions about that.
Greetings,
holger

I am needing to create a sort of "plug-in architecture" whereby different Web sites I maintain on the same server have slightly different functionality. Some Web sites will need to use the functionality in some assemblies, while others will get similar functionalilty from different assemblies.

What I was thinking about doing - and I'd apprecaite your feedback on this - is to load the assemblies required by a particular site into the site's default application domain, and do this loading during Application_Start. I would load the assemblies via Reflection (e.g., Assembly.Load()).

Two benefits of doing it this way:
1. I can have all the logic in one place... this is the logic that determines which assemblies to load for the current site.

2. A minor benefit is that when members from a given assembly are eventually required, the assembly is already loaded, thereby helping with runtime performance.

Are there any significant downsides to doing it this way, or reasons I should not preload these assemblies? Any "gotchas" I should account for?

Thanks!


--
Holger Kreissl
..NET Software Developer
http://kreissl.blogspot.com/
.



Relevant Pages

  • Re: Make a DLL in C# for FoxPro
    ... Interop from managed -> COM is a different story, here we are talking about new developments, and here you have probably accepted the larger memory footprint :-) ... The first is handled by the DLL/C++ code I posted which loads the .NET runtime and allows loading of assemblies and types. ... If you're not adverse to registering components you can completely skip this step and just use the .NET wrapper component from FoxPro with CreateObject. ... *** Load Static Method ...
    (microsoft.public.dotnet.languages.csharp)
  • RE: bizarre asp.net app loading failure
    ... I gave it a try but unfortunately the fusion logs didn't show ... I see a bunch of assembly load logs for application 3e70de80 ... (presumably the name for the app pool). ... of assemblies that reference it, even though they are not used by all the ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Force Load DLL From Different Dir?
    ... try load the version MyAddIn bound to at compile time. ... Actually this is NOT version related, but context related: Assemblies can ... Microsoft Online Community Support ...
    (microsoft.public.dotnet.framework)
  • RE: some other problems
    ... | What you said is reasonable, but how can IE load the assembly ... you try to load the same page in your customized browser the assembly is ... First off the only browser that should be able to load assemblies is ... | mscorlib.resources twice, one is successful, the other is not. ...
    (microsoft.public.dotnet.vjsharp)
  • Comparing the assembly name resulted in the mismatch: Minor Version
    ... I think the problem is hidden in some dark corner of the Microsoft universe. ... An error occurred during the processing of a configuration file ... Could not load file or assembly 'ADODB, ... Line 64: <assemblies> ...
    (microsoft.public.vstudio.development)