AssemblyNameProxy.GetAssemblyName Method (String)

 

Gets the AssemblyName for a given file.

Namespace:   System.Reflection
Assembly:  mscorlib (in mscorlib.dll)

public AssemblyName GetAssemblyName(
	string assemblyFile
)

Parameters

assemblyFile
Type: System.String

The assembly file for which to get the AssemblyName.

Return Value

Type: System.Reflection.AssemblyName

An AssemblyName object representing the given file.

Exception Condition
ArgumentNullException

assemblyFile is null.

ArgumentException

assemblyFile is empty.

FileNotFoundException

assemblyFile is not found.

SecurityException

The caller does not have the required permission.

BadImageFormatException

assemblyFile is not a valid assembly.

This will only work if the file contains an assembly manifest. This method causes the file to be opened and closed.

FileIOPermission

for access to information in the path. Associated enumeration: FileIOPermissionAccess.PathDiscovery

.NET Framework
Available since 1.1
Return to top
Show: