/ASSEMBLYLINKRESOURCE (Link to .NET Framework resource)

Create a link to a .NET Framework resource in the output file.

Syntax

/ASSEMBLYLINKRESOURCE:filename

Arguments

filename The .NET Framework resource file to link from the assembly.

Remarks

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 option to embed a resource file in the output file.

Linked resources are public in the assembly when created with the linker.

/ASSEMBLYLINKRESOURCE requires the /clr compiler option. The /LN or /NOASSEMBLY options aren't allowed with /ASSEMBLYLINKRESOURCE.

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

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.

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 Set C++ compiler and build properties in Visual Studio.

  2. Select the Configuration Properties > Linker > Command Line property page.

  3. Enter the option in Additional Options. Choose OK or Apply to apply the change.

To set this linker option programmatically

See also

MSVC linker reference
MSVC linker options