You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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](netmodule-files-as-linker-input.md).
51
44
52
45
### To set this linker option in the Visual Studio development environment
53
46
54
47
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).
@@ -43,7 +43,7 @@ Use **`PATH`** to specify a separate set of PGO counters for each unique path t
43
43
Specifies whether to use extra counters to keep an accurate count when exceptions are thrown during training. Use **`TRACKEH`** to specify extra counters for an exact count. Use **`NOTRACKEH`** to specify single counters for code that doesn't use exception handling or that doesn't run into exceptions in your training scenarios. When you specify **`/GENPROFILE`**, the default is **`TRACKEH`** . When you specify **`/FASTGENPROFILE`**, the default is **`NOTRACKEH`** .
44
44
45
45
**`PGD`**=*filename*\
46
-
Specifies a base file name for the *`.pgd`* file. By default, the linker uses the base executable image file name with a *`.pgd`* extension.
46
+
Specifies a base file name for the *`.pgd`* file. By default, the linker uses the base executable image file name with a *`.pgd`* extension. Must not exceed `MAX_PATH` (260) characters.
An absolute or relative path specification. By specifying a path, you affect only the location of an .idl file; all other files are placed in the project directory.
18
18
19
19
*`filename`*\
20
-
Specifies the name of the .idl file created by the MIDL compiler. No file extension is assumed; specify *filename*.idl if you want an .idl extension. The path and filename must not exceed `MAX_PATH` (260) characters.
20
+
Specifies the name of the .idl file created by the MIDL compiler. No file extension is assumed; specify *filename*.idl if you want an .idl extension. The path plus filename must not exceed `MAX_PATH` (260) characters.
A user-specified name for the import library. It replaces the default name.
14
+
*`filename`*\
15
+
A user-specified name for the import library. It replaces the default name. Must not exceed `MAX_PATH` (260) characters.
17
16
18
17
## Remarks
19
18
20
-
The /IMPLIB option overrides the default name for the import library that LINK creates when it builds a program that contains exports. The default name is formed from the base name of the main output file and the extension .lib. A program contains exports if one or more of the following are specified:
19
+
The `/IMPLIB` option overrides the default name for the import library that LINK creates when it builds a program that contains exports. The default name is formed from the base name of the main output file and the extension .lib. A program contains exports if one or more of the following are specified:
21
20
22
21
- The [__declspec(dllexport)](../../cpp/dllexport-dllimport.md) keyword in the source code
23
-
24
22
-[EXPORTS](exports.md) statement in a .def file
25
-
26
23
- An [/EXPORT](export-exports-a-function.md) specification in a LINK command
27
24
28
-
LINK ignores /IMPLIB when an import library is not being created. If no exports are specified, LINK does not create an import library. If an export file is used in the build, LINK assumes that an import library already exists and does not create one. For information on import libraries and export files, see [LIB Reference](lib-reference.md).
25
+
LINK ignores `/IMPLIB`/ when an import library is not being created. If no exports are specified, LINK does not create an import library. If an export file is used in the build, LINK assumes that an import library already exists and does not create one. For information on import libraries and export files, see [LIB Reference](lib-reference.md).
29
26
30
27
### To set this linker option in the Visual Studio development environment
31
28
@@ -41,5 +38,5 @@ LINK ignores /IMPLIB when an import library is not being created. If no exports
# /KEYFILE (Specify Key or Key Pair to Sign an Assembly)
10
9
11
-
```
10
+
```cmd
12
11
/KEYFILE:filename
13
12
```
14
13
15
14
## Arguments
16
15
17
-
*filename*<br/>
18
-
File that contains the key. Place the string in double quotation marks (" ") if it contains a space.
16
+
*`filename`*\
17
+
File that contains the key. Place the string in double quotation marks (" ") if it contains a space. Must not exceed `MAX_PATH` (260) characters.
19
18
20
19
## Remarks
21
20
22
-
The linker inserts the public key into the assembly manifest and then signs the final assembly with the private key. To generate a key file, type [sn -k](/dotnet/framework/tools/sn-exe-strong-name-tool)*filename* at the command line. A signed assembly is said to have a strong name.
21
+
The linker inserts the public key into the assembly manifest and then signs the final assembly with the private key. To generate a key file, type [`sn -k`](/dotnet/framework/tools/sn-exe-strong-name-tool)*filename* at the command line. A signed assembly is said to have a strong name.
23
22
24
-
If you compile with [/LN](ln-create-msil-module.md), the name of the key file is held in the module and incorporated into the assembly that is created when you compile an assembly that includes an explicit reference to the module, via [#using](../../preprocessor/hash-using-directive-cpp.md), or when linking with [/ASSEMBLYMODULE](assemblymodule-add-a-msil-module-to-the-assembly.md).
23
+
If you compile with [`/LN`](ln-create-msil-module.md), the name of the key file is held in the module and incorporated into the assembly that is created when you compile an assembly that includes an explicit reference to the module, via [`#using`](../../preprocessor/hash-using-directive-cpp.md), or when linking with `[/ASSEMBLYMODULE`](assemblymodule-add-a-msil-module-to-the-assembly.md).
25
24
26
-
You can also pass your encryption information to the linker with [/KEYCONTAINER](keycontainer-specify-a-key-container-to-sign-an-assembly.md). Use [/DELAYSIGN](delaysign-partially-sign-an-assembly.md) if you want a partially signed assembly. For more information on signing an assembly, see [Strong Name Assemblies (Assembly Signing) (C++/CLI)](../../dotnet/strong-name-assemblies-assembly-signing-cpp-cli.md) and [Creating and Using Strong-Named Assemblies](/dotnet/framework/app-domains/create-and-use-strong-named-assemblies).
25
+
You can also pass your encryption information to the linker with [`/KEYCONTAINER`](keycontainer-specify-a-key-container-to-sign-an-assembly.md). Use [`/DELAYSIGN`](delaysign-partially-sign-an-assembly.md) if you want a partially signed assembly. For more information on signing an assembly, see [Strong Name Assemblies (Assembly Signing) (C++/CLI)](../../dotnet/strong-name-assemblies-assembly-signing-cpp-cli.md) and [Creating and Using Strong-Named Assemblies](/dotnet/framework/app-domains/create-and-use-strong-named-assemblies).
27
26
28
-
In case both **/KEYFILE** and **/KEYCONTAINER** are specified (either by command-line option or by custom attribute), the linker will first try the key container. If that succeeds, then the assembly is signed with the information in the key container. If the linker doesn't find the key container, it will try the file specified with /KEYFILE. If that succeeds, the assembly is signed with the information in the key file and the key information will be installed in the key container (similar to sn -i) so that on the next compilation, the key container will be valid.
27
+
In case both **`/KEYFILE`** and **`/KEYCONTAINER`** are specified (either by command-line option or by custom attribute), the linker will first try the key container. If that succeeds, then the assembly is signed with the information in the key container. If the linker doesn't find the key container, it will try the file specified with /KEYFILE. If that succeeds, the assembly is signed with the information in the key file and the key information will be installed in the key container (similar to sn -i) so that on the next compilation, the key container will be valid.
29
28
30
29
A key file might contain only the public key.
31
30
32
31
Other linker options that affect assembly generation are:
### To set this linker option in the Visual Studio development environment
45
40
46
41
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).
/MANIFESTFILE lets you change the default name of the manifest file. The default name of the manifest file is the file name with .manifest appended.
16
+
Specify `/MANIFESTFILE` to change the default name of the manifest file. The default name of the manifest file is `filename`with `.manifest` appended. The resulting manifest file name must not exceed `MAX_PATH` (260) characters.
18
17
19
-
/MANIFESTFILE will have no effect if you do not also link with [/MANIFEST](manifest-create-side-by-side-assembly-manifest.md).
18
+
`/MANIFESTFILE` has no effect if you do not also link with [`/MANIFEST`](manifest-create-side-by-side-assembly-manifest.md).
20
19
21
20
### To set this linker option in the Visual Studio development environment
0 commit comments