.NET Framework Class Library
Assembly..::.LoadFile Method

Loads the contents of an assembly file.

Overload List

  NameDescription
Public methodStatic memberLoadFile(String)Loads the contents of an assembly file on the specified path.
Public methodStatic memberLoadFile(String, Evidence)Loads an assembly given its path, loading the assembly into the domain of the caller using the supplied evidence.
Top
See Also

Reference

Tags :


Community Content

Thomas Lee
LoadFile sample using PowerShell
# Get-AssemblyVersion.ps1
# Sample using PowerShell
# Thomas Lee - tfl@psp.co.uk

# Define the assembly we want to load - a random reference assembly from SDK 3.0
$Pshfile = "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\v3.0\system.speech.dll"

# Now load the assembly
$Myasm = [System.Reflection.Assembly]::Loadfile($Pshfile)

# Get name, version and display the results
$Aname = $Myasm.GetName()
$Aver = $Aname.version

# display results
"Assembly: {0} has version number of: {1}" -f $Aname.name, $aver

This script produces the following output:
PS C:\foo> .\get-assemblyversion.ps1
Assembly: System.Speech has version number of: 3.0.0.0

Page view tracker