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 / March 2006

Tip: Looking for answers? Try searching our database.

LoadFrom() and probing paths

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Peter Ritchie - 02 Mar 2006 19:01 GMT
I observed some interesting behaviour during some testing of
Assembly.LoadFrom. I noticed that Assembly.LoadFrom (and
Activator.CreateInstanceFrom) seems to extend the probing directory list.  
i.e. the private probe paths seem to include both AppDomain.ApplicationBase
and the directory specified in the LoadFrom call.

I would have expected it would be more secure to override ApplicationBase.

For example, given the following files:

APP\APP.exe
APP\Manager.dll
RULES\MgrUtil.dll
RULES\rule.dll

Where Manager.dll has a reference to MgrUtil.dll.

If I create an AppDomain whose ApplicationBase is RULES that uses
Assembly.LoadFrom("..\Manager.dll") the load works.  I would have expected it
to only work if MgrUtil.dll was in APP, despite RULES being a subdirectory of
APP.  Adding RULES to the probing list would be easy; I just didn't expect
the default behaviour to not require it.

Security/permissions and expansion of relative paths have not been shown.

Is this by design?

Signature

http://www.peterRitchie.com/blog/

"Gary Chang[MSFT]" - 03 Mar 2006 03:42 GMT
Hi Peter,

>If I create an AppDomain whose ApplicationBase is
>Assembly.LoadFrom("..\Manager.dll") the load works.  
>I would have expected it to only work if MgrUtil.dll was
>in APP, despite RULES being a subdirectory of APP.

Based on my understanding, you concern about the directory which specified
in the AppDomainSetup.ApplicationBase property should not be add it into
the probing paths, or it may need more security/permissions requirement on
it. Please let me know if I have misunderstood anything.

AFAIK, the directory specified in the AppDomainSetup.ApplicationBase
property would be the location where the assembly manager begins probing
for assemblies. I think such a probing path behavior is as expected.

Thanks!

Best regards,

Gary Chang
Microsoft Community Support
======================================================
PLEASE NOTE the newsgroup SECURE CODE and PASSWORD will be updated at 9:00
AM PST, February 14, 2006.  Please complete a re-registration process by
entering the secure code mmpng06 when prompted. Once you have entered the
secure code mmpng06, you will be able to update your profile and access the
partner newsgroups.
======================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from this issue.
======================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
======================================================
Peter Ritchie - 03 Mar 2006 05:58 GMT
You don't sound very certain.

Signature

http://www.peterRitchie.com/blog/

> Hi Peter,
>
[quoted text clipped - 30 lines]
> This posting is provided "AS IS" with no warranties, and confers no rights.
> ======================================================
"Gary Chang[MSFT]" - 07 Mar 2006 02:19 GMT
Hi Peter,

>You don't sound very certain.

I am afraid that's my favorite tone.

Thanks for your understanding!

Best regards,

Gary Chang
Microsoft Community Support
======================================================
PLEASE NOTE the newsgroup SECURE CODE and PASSWORD will be updated at 9:00
AM PST, February 14, 2006.  Please complete a re-registration process by
entering the secure code mmpng06 when prompted. Once you have entered the
secure code mmpng06, you will be able to update your profile and access the
partner newsgroups.
======================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from this issue.
======================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
======================================================

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.