|
1 | 1 | ---
|
2 |
| -description: "Learn more about: /ASSEMBLYLINKRESOURCE (Link to .NET Framework Resource)" |
3 |
| -title: "/ASSEMBLYLINKRESOURCE (Link to .NET Framework Resource)" |
4 |
| -ms.date: "11/04/2016" |
| 2 | +description: "Learn more about: /ASSEMBLYLINKRESOURCE (Link to .NET Framework resource)" |
| 3 | +title: "/ASSEMBLYLINKRESOURCE (Link to .NET Framework resource)" |
| 4 | +ms.date: 05/11/2022 |
5 | 5 | f1_keywords: ["/ASSEMBLYLINKRESOURCE", "VC.Project.VCLinkerTool.AssemblyLinkResource"]
|
6 | 6 | helpviewer_keywords: ["-ASSEMBLYLINKRESOURCE linker option", "ASSEMBLYLINKRESOURCE linker option", "/ASSEMBLYLINKRESOURCE linker option"]
|
7 | 7 | ms.assetid: 8b6ad184-1b33-47a4-8513-4803cf915b64
|
8 | 8 | ---
|
9 |
| -# /ASSEMBLYLINKRESOURCE (Link to .NET Framework Resource) |
| 9 | +# `/ASSEMBLYLINKRESOURCE` (Link to .NET Framework resource) |
10 | 10 |
|
11 |
| -``` |
12 |
| -/ASSEMBLYLINKRESOURCE:filename |
13 |
| -``` |
| 11 | +Create a link to a .NET Framework resource in the output file. |
| 12 | + |
| 13 | +## Syntax |
| 14 | + |
| 15 | +> **`/ASSEMBLYLINKRESOURCE:`*`filename`*** |
14 | 16 |
|
15 | 17 | ## Arguments
|
16 | 18 |
|
17 |
| -*filename*<br/> |
18 |
| -The .NET Framework resource file to which you want to link from the assembly. |
| 19 | +*`filename`* |
| 20 | +The .NET Framework resource file to link from the assembly. |
19 | 21 |
|
20 | 22 | ## Remarks
|
21 | 23 |
|
22 |
| -The /ASSEMBLYLINKRESOURCE option creates a link to a .NET Framework resource in the output file; the resource file is not placed in the output file. [/ASSEMBLYRESOURCE](assemblyresource-embed-a-managed-resource.md) embeds a resource file in the output file. |
| 24 | +The **`/ASSEMBLYLINKRESOURCE`** linker option creates a link to a .NET Framework resource in the output file. The resource file isn't placed in the output file. Use the [`/ASSEMBLYRESOURCE`](assemblyresource-embed-a-managed-resource.md) option to embed a resource file in the output file. |
23 | 25 |
|
24 | 26 | Linked resources are public in the assembly when created with the linker.
|
25 | 27 |
|
26 |
| -/ASSEMBLYLINKRESOURCE requires that the compilation include [/clr](clr-common-language-runtime-compilation.md); [/LN](ln-create-msil-module.md) or [/NOASSEMBLY](noassembly-create-a-msil-module.md) is not allowed with /ASSEMBLYLINKRESOURCE. |
| 28 | +**`/ASSEMBLYLINKRESOURCE`** requires the [`/clr`](clr-common-language-runtime-compilation.md) compiler option. The [`/LN`](ln-create-msil-module.md) or [`/NOASSEMBLY`](noassembly-create-a-msil-module.md) options aren't allowed with **`/ASSEMBLYLINKRESOURCE`**. |
27 | 29 |
|
28 |
| -If *filename* is a .NET Framework resource file created, for example, by [Resgen.exe](/dotnet/framework/tools/resgen-exe-resource-file-generator) or in the development environment, it can be accessed with members in the **System.Resources** namespace. For more information, see [System.Resources.ResourceManager](/dotnet/api/system.resources.resourcemanager). For all other resources, use the **GetManifestResource**\* methods in the **System.Reflection.Assembly** class to access the resource at run time. |
| 30 | +If *`filename`* is a .NET Framework resource file that's created, for example, by [`Resgen.exe`](/dotnet/framework/tools/resgen-exe-resource-file-generator) or in the development environment, it can be accessed with members in the `System.Resources` namespace. For more information, see [`System.Resources.ResourceManager`](/dotnet/api/system.resources.resourcemanager). For all other resources, use the `GetManifestResource*` methods in the `System.Reflection.Assembly` class to access the resource at run time. |
29 | 31 |
|
30 |
| -*filename* can be any file format. For example, you may want to make a native DLL part of the assembly, so it can be installed into the Global Assembly Cache and accessed from managed code in the assembly. |
| 32 | +*`filename`* can have any file format. For example, you may want to make a native DLL part of the assembly. Then it can be installed into the Global Assembly Cache and accessed from managed code in the assembly. |
31 | 33 |
|
32 | 34 | Other linker options that affect assembly generation are:
|
33 | 35 |
|
34 |
| -- [/ASSEMBLYDEBUG](assemblydebug-add-debuggableattribute.md) |
| 36 | +- [`/ASSEMBLYDEBUG`](assemblydebug-add-debuggableattribute.md) |
35 | 37 |
|
36 |
| -- [/ASSEMBLYMODULE](assemblymodule-add-a-msil-module-to-the-assembly.md) |
| 38 | +- [`/ASSEMBLYMODULE`](assemblymodule-add-a-msil-module-to-the-assembly.md) |
37 | 39 |
|
38 |
| -- [/ASSEMBLYRESOURCE](assemblyresource-embed-a-managed-resource.md) |
| 40 | +- [`/ASSEMBLYRESOURCE`](assemblyresource-embed-a-managed-resource.md) |
39 | 41 |
|
40 |
| -- [/DELAYSIGN](delaysign-partially-sign-an-assembly.md) |
| 42 | +- [`/DELAYSIGN`](delaysign-partially-sign-an-assembly.md) |
41 | 43 |
|
42 |
| -- [/KEYCONTAINER](keycontainer-specify-a-key-container-to-sign-an-assembly.md) |
| 44 | +- [`/KEYCONTAINER`](keycontainer-specify-a-key-container-to-sign-an-assembly.md) |
43 | 45 |
|
44 |
| -- [/KEYFILE](keyfile-specify-key-or-key-pair-to-sign-an-assembly.md) |
| 46 | +- [`/KEYFILE`](keyfile-specify-key-or-key-pair-to-sign-an-assembly.md) |
45 | 47 |
|
46 |
| -- [/NOASSEMBLY](noassembly-create-a-msil-module.md) |
| 48 | +- [`/NOASSEMBLY`](noassembly-create-a-msil-module.md) |
47 | 49 |
|
48 | 50 | ### To set this linker option in the Visual Studio development environment
|
49 | 51 |
|
50 | 52 | 1. Open the project's **Property Pages** dialog box. For details, see [Set C++ compiler and build properties in Visual Studio](../working-with-project-properties.md).
|
51 | 53 |
|
52 | 54 | 1. Select the **Configuration Properties** > **Linker** > **Command Line** property page.
|
53 | 55 |
|
54 |
| -1. Type the option into the **Additional Options** box. |
| 56 | +1. Enter the option in **Additional Options**. Choose **OK** or **Apply** to apply the change. |
55 | 57 |
|
56 | 58 | ### To set this linker option programmatically
|
57 | 59 |
|
58 | 60 | - See <xref:Microsoft.VisualStudio.VCProjectEngine.VCLinkerTool.AdditionalOptions%2A>.
|
59 | 61 |
|
60 | 62 | ## See also
|
61 | 63 |
|
62 |
| -[MSVC linker reference](linking.md)<br/> |
63 |
| -[MSVC Linker Options](linker-options.md) |
| 64 | +[MSVC linker reference](linking.md)\ |
| 65 | +[MSVC linker options](linker-options.md) |
0 commit comments