Problem w/ load context ?!

J

Julie

I have an app that was working as expected under VS2005/2.0. We just
switched to VS2008, and are now experiencing some assembly loading problems.

Here is the scenario:

c:\folder\app.exe
c:\folder\shared.dll

c:\another\myderivedclass.dll
c:\another\shared.dll


shared.dll is the same assembly is referenced by both app.exe and
myderivedclass.dll.

app.exe dynamically loads myderivedclass.dll using
Assembly.LoadFrom(assemblyName) and attempts to create an instance of a
class in myderivedclass.dll. That class derives from a class defined in
shared.dll.

Under VS05, the fusion log shows that shared.dll is bound from c:\folder
when app.exe starts AND when dynamically loading myderivedclass.dll.

HOWEVER, under VS08, the fusion log shows that shared.dll is bound from
c:\folder when app.exe starts BUT from c:\another when dynamically
loading myderivedclass.dll. Everything dies when attempting to cast to
the base class in app.exe for obvious reasons.

So, WHY the change between VS05 and 08?

Are there any app.config changes I can make to force the loading of
shared.dll from c:\folder?

I have the source to app.exe, but at the moment, I'm not able to modify
the code -- hoping for a solution through configuration or changing
myderivedclass.dll

Thanks for any info.

-j
 
J

Jeffrey Tan[MSFT]

Hi Julie ,

This looks like an interesting issue. Do you have any sample solution
containing three sample projects for reproducing? If I can give it a local
reproduce, I can troubleshoot it better and understand why it fails. You
may attach the sample solution in a further reply using Outlook Express.

Additionally, why not place the myderivedclass.dll and shared.dll in a
sub-directory of app.exe. Then you may use Assembly.Load context with the
<probing> configure file setting to load these two assemblies. I assume
this will workaround your problem.

Thanks.

Best regards,
Jeffrey Tan
Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
 
J

Jeffrey Tan[MSFT]

Hi Julie ,

Have you reviewed my reply to you? If you still need any help, please feel
free to feedback, thanks.

Best regards,
Jeffrey Tan
Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top