Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / February 2007

Tip: Looking for answers? Try searching our database.

GAC, AssemblyResolve event, fusion.dll, Assembly.Load fails

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
jc - 01 Feb 2007 20:40 GMT
I am having an issue where Assembly.Load fails,
even after installing a signed assembly to the GAC via the fusion.dll
API.

I have supplied a link to the simple test harness that reproduces the
issue.

I use the AssemblyResolve event to determine what assemblies are
missing and
so are needed to be remotely
downloaded to the local machine and installed into the GAC.
After an initial Assembly.Load call the AssemblyResolve event is fired
as expected.
In the event handler, the assembly is installed fine via the
fusion.dll API, however when the assembly
is attempted to be loaded from the GAC via Assembly.Load, the call
will cause the
AssemblyResolve to fire again, and again, and again.. etc. infinite
loop.
If I where to exit the app and start it again the firs call to
Assembly.Load is succesful as is
expected since it in the GAC. I would not expect the before mentioned
inifinite loop of
AssemblyResolve events, since I would think the CLR would find it once
in the GAC.

It seems the CLR perhaps has already probed for the dll in the initial
Assembly.Load call. So whether it found it or not the CLR has finished
probing and will not look in the GAC for the newly installed assembly
until I restart the app which causes the CLR to probe again for the
assembly.

Is there a way to have the CLR probe again without restarting the app?

Here is the link to the simple test harness that reproduces the issue.
http://oxygenaddicts.com/code/GACTest.zip

Any help on this issue is greatly appreciated.

Thanks
Ben Voigt - 12 Feb 2007 21:09 GMT
>I am having an issue where Assembly.Load fails,
> even after installing a signed assembly to the GAC via the fusion.dll
[quoted text clipped - 24 lines]
> It seems the CLR perhaps has already probed for the dll in the initial
> Assembly.Load call. So whether it found it or not the CLR has finished
Yes, I've seen that happen as well.  It's a good thing.

> probing and will not look in the GAC for the newly installed assembly
> until I restart the app which causes the CLR to probe again for the
> assembly.
>
> Is there a way to have the CLR probe again without restarting the app?
Why?  Why not Assembly.LoadFrom or Assembly.LoadFile the dll after placing
it into the GAC, and then return that Assembly instance from
AssemblyResolve?  That's what I do (well actually I don't use the GAC, but I
do load from a private plugins directory) and it works well enough.

> Here is the link to the simple test harness that reproduces the issue.
> http://oxygenaddicts.com/code/GACTest.zip
>
> Any help on this issue is greatly appreciated.
>
> Thanks

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.