Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.
1 out of 8 rated this helpful - Rate this topic

Assembly.GetManifestResourceStream Method (String)

Loads the specified manifest resource from this assembly.

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

public virtual Stream GetManifestResourceStream (
	string name
)
public Stream GetManifestResourceStream (
	String name
)
public function GetManifestResourceStream (
	name : String
) : Stream
Not applicable.

Parameters

name

The case-sensitive name of the manifest resource being requested.

Return Value

A Stream representing the manifest resource; a null reference (Nothing in Visual Basic) if no resources were specified during compilation, or if the resource is not visible to the caller.
Exception typeCondition

ArgumentNullException

The name parameter is a null reference (Nothing in Visual Basic).

ArgumentException

The name parameter is an empty string ("").

FileLoadException

A file that was found could not be loaded.

FileNotFoundException

name was not found.

BadImageFormatException

name is not a valid assembly.

Resource information is returned only if the resource is visible to the caller, or the caller has ReflectionPermission.

NoteNote:

This method returns a null reference (Nothing in Visual Basic) if a private resource in another assembly is accessed and the caller does not have ReflectionPermission with the ReflectionPermissionFlag.MemberAccess flag.

If the assembly manifest lists a resource file, GetManifestResourceStream returns a Stream object even if the resource file cannot be found on disk at the time. If the resource file is not found, passing the resulting Stream object to the ResourceReader constructor causes an ArgumentException.

  • ReflectionPermission  to access a private resource. Associated enumeration: ReflectionPermissionFlag.MemberAccess
  • ReflectionPermission  when invoked late-bound through mechanisms such as Type.InvokeMember. Associated enumeration: ReflectionPermissionFlag.MemberAccess.

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0, 1.1, 1.0

.NET Compact Framework

Supported in: 2.0, 1.0

XNA Framework

Supported in: 1.0
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

Show:
© 2014 Microsoft. All rights reserved.