• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 5834
  • Last Modified:

Difference between "Assembly.Load" & "Assembly.LoadFrom" & "Assembly.LoadFile" in VB.NET / C#

Hi,

Can you please explain me what is the difference between "Assembly.Load"  &  "Assembly.LoadFrom"  &  "Assembly.LoadFile" in VB.NET or C# with simple examples ? Need simple explanation for me to understand the basic concept.

Thanks
0
kishore_peddi
Asked:
kishore_peddi
1 Solution
 
JimBrandleyCommented:
Given an assembly name, load the assembly:
Assembly.Load(MyAssembly);

Given an assembly file name, load the assembly:
Assembly.LoadFile( "MyAssembly.DLL");
OR
Assembly.LoadFrom("MyAssembly.DLL");

The second form is supported by the compact framework. The later two methods can also take varification that you have permission to access the assembly. See:
ms-help://MS.VSCC.v80/MS.MSDN.v80/MS.NETDEVFX.v20.en/cpref11/html/T_System_Security_Policy_Evidence.htm

Jim
0
 
patilmmilindCommented:
Hi, It's a basi question and very important if you want to work loading assemblies dynamically. It is kind of late binding.

The major difference is: Assembly.Load() takes an assembly display name as input, while Assembly.LoadFrom() takes a file path as input.
Visit the following link for more information .........

http://codeidol.com/visual-basic/vbasic-2005/Reflection/Working-with-Assemblies-and-Modules/

Best luck
Regards,
Milind



0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now