AssemblyBuilder.CreateEmbeddedResource Method

Allows a build provider to create a resource file to include in the assembly compilation.

Namespace:  System.Web.Compilation
Assembly:  System.Web (in System.Web.dll)

public Stream CreateEmbeddedResource(
	BuildProvider buildProvider,
	string name
)

Parameters

buildProvider
Type: System.Web.Compilation.BuildProvider

The build provider generating the resource.

name
Type: System.String

The name of the resource file to be created.

Return Value

Type: System.IO.Stream
An open Stream that can be used to write resources, which are included in the assembly compilation.

ExceptionCondition
ArgumentException

name is not a valid file name.

After calling the CreateEmbeddedResource method, a BuildProvider object writes the resource file contents using the returned Stream object. For example, the build provider can write the resources using a ResourceWriter object. After writing the resource file, the build provider must use the Close method to close the Stream object and free associated system resources.

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2015 Microsoft