Skip to content

Latest commit

 

History

History
72 lines (50 loc) · 3.28 KB

assemblyresource-embed-a-managed-resource.md

File metadata and controls

72 lines (50 loc) · 3.28 KB
title ms.custom ms.date ms.reviewer ms.suite ms.technology ms.tgt_pltfrm ms.topic f1_keywords dev_langs helpviewer_keywords ms.assetid caps.latest.revision author ms.author manager
-ASSEMBLYRESOURCE (Embed a Managed Resource) | Microsoft Docs
11/04/2016
cpp-tools
article
VC.Project.VCLinkerTool.EmbedManagedResourceFile
/ASSEMBLYRESOURCE
C++
ASSEMBLYRESOURCE linker option
assemblies [C++]
-ASSEMBLYRESOURCE linker option
assemblies [C++], linking resource files
/ASSEMBLYRESOURCE linker option
0ce6e1fb-921b-4b1b-a59c-d35388d789f2
12
corob-msft
corob
ghogen

/ASSEMBLYRESOURCE (Embed a Managed Resource)

/ASSEMBLYRESOURCE:filename[,[name][,PRIVATE]]  

Parameters

filename
The managed resource you want to embed in this assembly.

name
Optional. The logical name for the resource; the name used to load the resource. The default is the name of the file.

Optionally, you can specify if the file should be private in the assembly manifest. By default, name is public in the assembly.

Remarks

Use the /ASSEMBLYRESOURCE option to embed a resource in an assembly.

Resources are public in the assembly when created with the linker. The linker does not allow you to rename the resource in the assembly.

If filename is a .NET Framework resource (.resources) file created, for example, by the Resource File Generator (Resgen.exe) or in the development environment, it can be accessed with members in the System.Resources namespace (see System.Resources.ResourceManager for more information). For all other resources, use the GetManifestResource* methods in System.Reflection.Assembly class to access the resource at run time.

Other linker options that affect assembly generation are:

To set this linker option in the Visual Studio development environment

  1. Open the project's Property Pages dialog box. For details, see Setting Visual C++ Project Properties.

  2. Click the Linker folder.

  3. Click the Input property page.

  4. Modify the Embed Managed Resource File property.

To set this linker option programmatically

  1. See xref:Microsoft.VisualStudio.VCProjectEngine.VCLinkerTool.EmbedManagedResourceFile%2A.

See Also

Setting Linker Options
Linker Options