Редактиране

Споделяне чрез


/ASSEMBLYMODULE (Add an MSIL module to the assembly)

Syntax

/ASSEMBLYMODULE:filename

Arguments

filename
The module you want to include in this assembly.

Remarks

The /ASSEMBLYMODULE linker option allows you to add a module reference to an assembly. Type information in the module won't be available to the assembly program that added the module reference. However, type information in the module will be available to any program that references the assembly.

Use #using to both add a module reference to an assembly and make the module's type information available to the assembly program.

For example, consider the following scenario:

  1. Create a module with /LN.

  2. Use /ASSEMBLYMODULE in a different project to include the module in the current compilation, which creates an assembly. This project won't reference the module with #using.

  3. Any project that references this assembly can now also use types from the module.

Other linker options that affect assembly generation are:

The MSVC linker accepts .netmodule files as input and the output file produced by the linker will be an assembly or .netmodule file with no run-time dependence on any of the .netmodule files that were input to the linker. For more information, see .netmodule files as linker input.

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 > Input property page.

  3. Modify the Add Module to Assembly property.

To set this linker option programmatically

See also

MSVC linker reference
MSVC linker options