System.Reflection.Emit.AssemblyBuilder.DefineResource Method

Defines a standalone managed resource for this assembly with the default public resource attribute.

Syntax

public System.Resources.IResourceWriter DefineResource (string name, string description, string fileName)

Parameters

name
The logical name of the resource.
description
A textual description of the resource.
fileName
The physical file name (.resources file) to which the logical name is mapped. This should not include a path.

Returns

A System.Resources.ResourceWriter object for the specified resource.

Remarks

Fine grain resources can be added with the returned System.Resources.ResourceWriter by calling System.Resources.ResourceWriter.AddResource(string, string).

fileName should not be the same as that of any other persistable module, stand-alone managed resource, or the stand-alone manifest file.

The runtime calls the System.Resources.ResourceWriter.Close method when the dynamic assembly is saved.

Note:

Starting with the net_v20sp1_long, this member no longer requires System.Security.Permissions.ReflectionPermission with the System.Security.Permissions.ReflectionPermissionFlag.ReflectionEmit flag. (See Security Issues in Reflection Emit.) To use this functionality, your application should target the net_v35_long or later.

Requirements

Namespace: System.Reflection.Emit
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0