Assembly.LoadFile Method
.NET Framework 4
Loads the contents of an assembly file.
This member is overloaded. For complete information about this member, including syntax, usage, and examples, click a name in the overload list.
| Name | Description | |
|---|---|---|
|
LoadFile(String) | Loads the contents of an assembly file on the specified path. |
|
LoadFile(String, Evidence) | Obsolete. Loads an assembly given its path, loading the assembly into the domain of the caller using the supplied evidence. |
Assembly.LoadFile locks the file
As the LoadFile method keeps a lock on the file through the lifetime of the parent process, you might consider using the Load method as:
Assembly.Load(System.IO.File.ReadAllBytes(filePath));
HTH
- 9/26/2011
- Mikael Håkansson
Assembly.LoadFrom/LoadFile/Load(byte[]) prefers GAC
According to: http://blogs.msdn.com/b/junfeng/archive/2004/11/03/252033.aspx
Starting in Whidbey beta2, for Assembly.LoadFrom/LoadFile/Load(byte[]), if there is an assembly in GAC with exactly the same assembly identity, we will return the one in GAC.
ReflectionOnlyLoad and ReflectionOnlyLoadFrom APIs are not affected.
Starting in Whidbey beta2, for Assembly.LoadFrom/LoadFile/Load(byte[]), if there is an assembly in GAC with exactly the same assembly identity, we will return the one in GAC.
ReflectionOnlyLoad and ReflectionOnlyLoadFrom APIs are not affected.
- 8/17/2010
- Dennis George