Defines a standalone managed resource for this assembly. Attributes can be specified for the managed resource.
[Visual Basic] Overloads Public Function DefineResource( _ ByVal name As String, _ ByVal description As String, _ ByVal fileName As String, _ ByVal attribute As ResourceAttributes _ ) As ResourceWriter [C#] public ResourceWriter DefineResource( string name, string description, string fileName, ResourceAttributes attribute ); [C++] public: ResourceWriter* DefineResource( String* name, String* description, String* fileName, ResourceAttributes attribute ); [JScript] public function DefineResource( name : String, description : String, fileName : String, attribute : ResourceAttributes ) : ResourceWriter;
A ResourceWriter object for the specified resource.
Exception Type | Condition |
---|---|
ArgumentException | If name has been previously defined |
Fine-grain resources can be added with the returned ResourceWriter by calling AddResource.
Filename should not be the same as that of any other persistable module, standalone managed resource, or the standalone manifest file.
NGWS Runtime Security:
ReflectionPermission | SecurityAction.Demand, ReflectionEmit=true |
AssemblyBuilder Class | AssemblyBuilder Members | System.Reflection.Emit Namespace | AssemblyBuilder.DefineResource Overload List