Skip to content

Repo sync for protected CLA branch #3907

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 13 additions & 12 deletions docs/build/reference/align-section-alignment.md
Original file line number Diff line number Diff line change
@@ -1,30 +1,31 @@
---
description: "Learn more about: /ALIGN (Section Alignment)"
title: "/ALIGN (Section Alignment)"
ms.date: "12/29/2017"
description: "Learn more about: /ALIGN (Section alignment)"
title: "/ALIGN (Section alignment)"
ms.date: 05/11/2022
f1_keywords: ["VC.Project.VCLinkerTool.Alignment", "/align"]
helpviewer_keywords: ["sections, specifying alignment", "ALIGN linker option", "/ALIGN linker option", "-ALIGN linker option", "section alignment", "sections"]
---
# /ALIGN (Section Alignment)
# `/ALIGN` (Section alignment)

Specify the alignment of each section within the executable image.
## Syntax

> **/ALIGN**[**:**_number_]
> **`/ALIGN`**\[**`:`*`number`***]

### Arguments

*number*<br/>
*`number`*\
The alignment value in bytes.

## Remarks

The **/ALIGN** option specifies the alignment of each section within the linear address space of the program. The *number* argument is in bytes and must be a power of two. The default is 4K (4096). The linker issues a warning if the alignment produces an invalid image.
The **`/ALIGN`** linker option specifies the alignment of each section within the linear address space of the program. The *`number`* argument is in bytes and must be a power of two. The default is 4K (4096). The linker issues a warning if the alignment produces an invalid image.

Unless you are writing an application such as a device driver, you should not need to modify the alignment.
Unless you're writing an application such as a device driver, you shouldn't need to modify the alignment.

It is possible to modify the alignment of a particular section with the align parameter to the [/SECTION](section-specify-section-attributes.md) option.
It's possible to modify the alignment of a particular section with the *`align`* parameter to the [`/SECTION`](section-specify-section-attributes.md) option.

The alignment value that you specify cannot be smaller than the largest section alignment.
The alignment value that you specify can't be smaller than the largest section alignment.

### To set this linker option in the Visual Studio development environment

Expand All @@ -40,5 +41,5 @@ The alignment value that you specify cannot be smaller than the largest section

## See also

[MSVC linker reference](linking.md)<br/>
[MSVC Linker Options](linker-options.md)
[MSVC linker reference](linking.md)\
[MSVC linker options](linker-options.md)
30 changes: 16 additions & 14 deletions docs/build/reference/allowbind-prevent-dll-binding.md
Original file line number Diff line number Diff line change
@@ -1,38 +1,40 @@
---
description: "Learn more about: /ALLOWBIND (Prevent DLL Binding)"
title: "/ALLOWBIND (Prevent DLL Binding)"
ms.date: "11/04/2016"
description: "Learn more about: /ALLOWBIND (Prevent DLL binding)"
title: "/ALLOWBIND (Prevent DLL binding)"
ms.date: 05/11/2022
f1_keywords: ["VC.Project.VCLinkerTool.PreventDLLBinding", "/allowbind"]
helpviewer_keywords: ["/ALLOWBIND linker option", "binding DLLs", "preventing DLL binding", "ALLOWBIND linker option", "-ALLOWBIND linker option", "DLLs [C++], preventing binding"]
ms.assetid: 30e37e24-12e4-407e-988a-39d357403598
---
# /ALLOWBIND (Prevent DLL Binding)
# `/ALLOWBIND` (Prevent DLL binding)

```
/ALLOWBIND[:NO]
```
Set a flag to disallow DLL binding.

## Syntax

> **`/ALLOWBIND`**\[**`:NO`**]

## Remarks

/ALLOWBIND:NO sets a bit in a DLL's header that indicates to Bind.exe that the image is not allowed to be bound. You may not want a DLL to be bound if it has been digitally signed (binding invalidates the signature).
The **`/ALLOWBIND:NO`** linker option sets a bit in a DLL's header that indicates to Bind.exe that the image can't be bound. You may not want a DLL to be bound if it's been digitally signed (binding invalidates the signature).

You can edit an existing DLL for /ALLOWBIND functionality with the [/ALLOWBIND](allowbind.md) option of the EDITBIN utility.
You can edit an existing DLL for **`/ALLOWBIND`** functionality with the [`/ALLOWBIND`](allowbind.md) option of the EDITBIN utility.

### 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](../working-with-project-properties.md).

1. Select the **Configuration Properties** > **Linker** > **Command Line** property page.

1. Enter `/ALLOWBIND:NO` into **Additional Options**.
1. Enter *`/ALLOWBIND:NO`* into **Additional Options**. Choose **OK** or **Apply** to apply the change.

### To set this linker option programmatically

- See <xref:Microsoft.VisualStudio.VCProjectEngine.VCCLCompilerTool.AdditionalOptions%2A>.

## See also

[MSVC linker reference](linking.md)<br/>
[MSVC Linker Options](linker-options.md)<br/>
[BindImage function](/windows/win32/api/imagehlp/nf-imagehlp-bindimage)<br/>
[BindImageEx function](/windows/win32/api/imagehlp/nf-imagehlp-bindimageex)
[MSVC linker reference](linking.md)\
[MSVC linker options](linker-options.md)\
[`BindImage` function](/windows/win32/api/imagehlp/nf-imagehlp-bindimage)\
[`BindImageEx` function](/windows/win32/api/imagehlp/nf-imagehlp-bindimageex)
26 changes: 12 additions & 14 deletions docs/build/reference/allowisolation-manifest-lookup.md
Original file line number Diff line number Diff line change
@@ -1,32 +1,30 @@
---
description: "Learn more about: /ALLOWISOLATION (Manifest Lookup)"
title: "/ALLOWISOLATION (Manifest Lookup)"
ms.date: "11/04/2016"
description: "Learn more about: /ALLOWISOLATION (Manifest lookup)"
title: "/ALLOWISOLATION (Manifest lookup)"
ms.date: 05/11/2022
f1_keywords: ["/ALLOWISOLATION", "VC.Project.VCLinkerTool.AllowIsolation"]
helpviewer_keywords: ["-ALLOWISOLATION linker option", "/ALLOWISOLATION linker option"]
ms.assetid: 6d41851e-b3c1-4bdf-beaa-031773089d6f
---
# /ALLOWISOLATION (Manifest Lookup)
# `/ALLOWISOLATION` (Manifest lookup)

Specifies behavior for manifest lookup.

## Syntax

```
/ALLOWISOLATION[:NO]
```
> **`/ALLOWISOLATION`**\[**`:NO`**]

## Remarks

**/ALLOWISOLATION:NO** indicates DLLs are loaded as if there was no manifest and causes the linker to set the `IMAGE_DLLCHARACTERISTICS_NO_ISOLATION` bit in the optional header's `DllCharacteristics` field.
The **`/ALLOWISOLATION:NO`** linker option indicates DLLs are loaded as if there was no manifest and causes the linker to set the `IMAGE_DLLCHARACTERISTICS_NO_ISOLATION` bit in the optional header's `DllCharacteristics` field.

**/ALLOWISOLATION** causes the operating system to do manifest lookups and loads.
**`/ALLOWISOLATION`** causes the operating system to do manifest lookups and loads.

**/ALLOWISOLATION** is the default.
**`/ALLOWISOLATION`** is the default.

When isolation is disabled for an executable, the Windows loader will not attempt to find an application manifest for the newly created process. The new process will not have a default activation context, even if there is a manifest inside the executable or placed in the same directory as the executable with name <em>executable-name</em>**.exe.manifest**.
When isolation is disabled for an executable, the Windows loader won't attempt to find an application manifest for the newly created process. The new process won't have a default activation context, even if there's a manifest inside the executable or placed in the same directory as the executable with name *`<executable-name>.exe.manifest`*.

For more information, see [Manifest Files Reference](/windows/win32/SbsCs/manifest-files-reference).
For more information, see [Manifest files reference](/windows/win32/SbsCs/manifest-files-reference).

### To set this linker option in the Visual Studio development environment

Expand All @@ -38,5 +36,5 @@ For more information, see [Manifest Files Reference](/windows/win32/SbsCs/manife

## See also

[MSVC linker reference](linking.md)<br/>
[MSVC Linker Options](linker-options.md)
[MSVC linker reference](linking.md)\
[MSVC linker options](linker-options.md)
26 changes: 11 additions & 15 deletions docs/build/reference/appcontainer-windows-store-app.md
Original file line number Diff line number Diff line change
@@ -1,36 +1,32 @@
---
description: "Learn more about: /APPCONTAINER (Microsoft Store App)"
title: "/APPCONTAINER (UWP/Microsoft Store App)"
ms.date: "11/04/2016"
description: "Learn more about: /APPCONTAINER (Microsoft Store app)"
title: "/APPCONTAINER (UWP/Microsoft Store app)"
ms.date: 05/11/2022
ms.assetid: 9a432db5-7640-460b-ab18-6f61fa7daf6f
---
# /APPCONTAINER (Microsoft Store App)
# `/APPCONTAINER` (Microsoft Store app)

Specifies whether the linker creates an executable image that must be run in an app container.
Specifies whether the linker creates an executable image that must run in an AppContainer environment.

## Syntax

```
/APPCONTAINER[:NO]
```
> **`/APPCONTAINER`**\[**`:NO`**]

## Remarks

By default, /APPCONTAINER is off.
The **`/APPCONTAINER`** linker option modifies an executable to indicate whether the app must run in the AppContainer process-isolation environment. Specify **`/APPCONTAINER`** for an app that must run in the AppContainer environment—for example, a Universal Windows Platform (UWP) or Windows Phone 8.x app. The option is set automatically in Visual Studio when you create a Universal Windows app from a template. For a desktop app, specify **`/APPCONTAINER:NO`** or just omit the option. By default, **`/APPCONTAINER`** is off.

This option modifies an executable to indicate whether the app must be run in the appcontainer process-isolation environment. Specify /APPCONTAINER for an app that must run in the appcontainer environment—for example, a Universal Windows Platform (UWP) or Windows Phone 8.x app. (The option is set automatically in Visual Studio when you create a Universal Windows app from a template.) For a desktop app, specify /APPCONTAINER:NO or just omit the option.

The /APPCONTAINER option was introduced in Windows 8.
The **`/APPCONTAINER`** option was introduced in Windows 8.

### To set this linker option in Visual Studio

1. Open the project **Property Pages** dialog box. For more information, see [Set C++ compiler and build properties in Visual Studio](../working-with-project-properties.md).

1. Select the **Configuration Properties** > **Linker** > **Command Line** property page.

1. In **Additional Options**, enter `/APPCONTAINER` or `/APPCONTAINER:NO`.
1. In **Additional Options**, enter *`/APPCONTAINER`* or *`/APPCONTAINER:NO`*.

## See also

[MSVC linker reference](linking.md)<br/>
[MSVC Linker Options](linker-options.md)
[MSVC linker reference](linking.md)\
[MSVC linker options](linker-options.md)
50 changes: 26 additions & 24 deletions docs/build/reference/assemblydebug-add-debuggableattribute.md
Original file line number Diff line number Diff line change
@@ -1,56 +1,58 @@
---
description: "Learn more about: /ASSEMBLYDEBUG (Add DebuggableAttribute)"
title: "/ASSEMBLYDEBUG (Add DebuggableAttribute)"
ms.date: "11/04/2016"
ms.date: 05/11/2022
f1_keywords: ["VC.Project.VCLinkerTool.AssemblyDebug", "/ASSEMBLYDEBUG"]
helpviewer_keywords: ["/ASSEMBLYDEBUG linker option", "-ASSEMBLYDEBUG linker option", "ASSEMBLYDEBUG linker option"]
ms.assetid: 94443af3-470c-41d7-83a0-7434563d7982
---
# /ASSEMBLYDEBUG (Add DebuggableAttribute)
# `/ASSEMBLYDEBUG` (Add DebuggableAttribute)

```
/ASSEMBLYDEBUG[:DISABLE]
```
Specify whether to emit the `DebuggableAttribute` attribute with debug information tracking and to disable JIT optimizations.

/ASSEMBLYDEBUG emits the **DebuggableAttribute** attribute with debug information tracking and disables JIT optimizations. This is the same as specifying the following attribute in source:
## Syntax

```
> **`/ASSEMBLYDEBUG`**\[**`:DISABLE`**]

## Remarks

The **`/ASSEMBLYDEBUG`** linker option emits the `DebuggableAttribute` attribute with debug information tracking and disables JIT optimizations. This option is the same as specifying the following attribute in source:

```cpp
[assembly:Debuggable(true, true)]; // same as /ASSEMBLYDEBUG
```

/ASSEMBLYDEBUG:DISABLE emits the **DebuggableAttribute** attribute but disables the tracking of debug information and enables JIT optimizations. This is the same as specifying the following attribute in source:
**`/ASSEMBLYDEBUG:DISABLE`** emits the `DebuggableAttribute` attribute but disables the tracking of debug information and enables JIT optimizations. This option is the same as specifying the following attribute in source:

```
```cpp
[assembly:Debuggable(false, false)]; // same as /ASSEMBLYDEBUG:DISABLE
```

The default is to not emit the **DebuggableAttribute** attribute.
By default, the linker doesn't emit the `DebuggableAttribute` attribute.

DebuggableAttribute can also be added to an assembly directly in source code. For example,
`DebuggableAttribute` can also be added to an assembly directly in source code. For example:

```
```cpp
[assembly:Debuggable(true, true)]; // same as /ASSEMBLYDEBUG
```

## Remarks

It is necessary to explicitly specify that a managed image be debuggable. Using [/Zi](z7-zi-zi-debug-information-format.md) alone is not sufficient.
You must explicitly specify that a managed image is debuggable. The [`/Zi`](z7-zi-zi-debug-information-format.md) option alone is insufficient.

Other linker options that affect assembly generation are:

- [/ASSEMBLYLINKRESOURCE](assemblylinkresource-link-to-dotnet-framework-resource.md)
- [`/ASSEMBLYLINKRESOURCE`](assemblylinkresource-link-to-dotnet-framework-resource.md)

- [/ASSEMBLYMODULE](assemblymodule-add-a-msil-module-to-the-assembly.md)
- [`/ASSEMBLYMODULE`](assemblymodule-add-a-msil-module-to-the-assembly.md)

- [/ASSEMBLYRESOURCE](assemblyresource-embed-a-managed-resource.md)
- [`/ASSEMBLYRESOURCE`](assemblyresource-embed-a-managed-resource.md)

- [/DELAYSIGN](delaysign-partially-sign-an-assembly.md)
- [`/DELAYSIGN`](delaysign-partially-sign-an-assembly.md)

- [/KEYCONTAINER](keycontainer-specify-a-key-container-to-sign-an-assembly.md)
- [`/KEYCONTAINER`](keycontainer-specify-a-key-container-to-sign-an-assembly.md)

- [/KEYFILE](keyfile-specify-key-or-key-pair-to-sign-an-assembly.md)
- [`/KEYFILE`](keyfile-specify-key-or-key-pair-to-sign-an-assembly.md)

- [/NOASSEMBLY](noassembly-create-a-msil-module.md)
- [`/NOASSEMBLY`](noassembly-create-a-msil-module.md)

### To set this linker option in the Visual Studio development environment

Expand All @@ -66,5 +68,5 @@ Other linker options that affect assembly generation are:

## See also

[MSVC linker reference](linking.md)<br/>
[MSVC Linker Options](linker-options.md)
[MSVC linker reference](linking.md)\
[MSVC linker options](linker-options.md)
Original file line number Diff line number Diff line change
@@ -1,63 +1,65 @@
---
description: "Learn more about: /ASSEMBLYLINKRESOURCE (Link to .NET Framework Resource)"
title: "/ASSEMBLYLINKRESOURCE (Link to .NET Framework Resource)"
ms.date: "11/04/2016"
description: "Learn more about: /ASSEMBLYLINKRESOURCE (Link to .NET Framework resource)"
title: "/ASSEMBLYLINKRESOURCE (Link to .NET Framework resource)"
ms.date: 05/11/2022
f1_keywords: ["/ASSEMBLYLINKRESOURCE", "VC.Project.VCLinkerTool.AssemblyLinkResource"]
helpviewer_keywords: ["-ASSEMBLYLINKRESOURCE linker option", "ASSEMBLYLINKRESOURCE linker option", "/ASSEMBLYLINKRESOURCE linker option"]
ms.assetid: 8b6ad184-1b33-47a4-8513-4803cf915b64
---
# /ASSEMBLYLINKRESOURCE (Link to .NET Framework Resource)
# `/ASSEMBLYLINKRESOURCE` (Link to .NET Framework resource)

```
/ASSEMBLYLINKRESOURCE:filename
```
Create a link to a .NET Framework resource in the output file.

## Syntax

> **`/ASSEMBLYLINKRESOURCE:`*`filename`***

## Arguments

*filename*<br/>
The .NET Framework resource file to which you want to link from the assembly.
*`filename`*
The .NET Framework resource file to link from the assembly.

## Remarks

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.
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.

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

/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.
**`/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`**.

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.
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.

*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.
*`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:

- [/ASSEMBLYDEBUG](assemblydebug-add-debuggableattribute.md)
- [`/ASSEMBLYDEBUG`](assemblydebug-add-debuggableattribute.md)

- [/ASSEMBLYMODULE](assemblymodule-add-a-msil-module-to-the-assembly.md)
- [`/ASSEMBLYMODULE`](assemblymodule-add-a-msil-module-to-the-assembly.md)

- [/ASSEMBLYRESOURCE](assemblyresource-embed-a-managed-resource.md)
- [`/ASSEMBLYRESOURCE`](assemblyresource-embed-a-managed-resource.md)

- [/DELAYSIGN](delaysign-partially-sign-an-assembly.md)
- [`/DELAYSIGN`](delaysign-partially-sign-an-assembly.md)

- [/KEYCONTAINER](keycontainer-specify-a-key-container-to-sign-an-assembly.md)
- [`/KEYCONTAINER`](keycontainer-specify-a-key-container-to-sign-an-assembly.md)

- [/KEYFILE](keyfile-specify-key-or-key-pair-to-sign-an-assembly.md)
- [`/KEYFILE`](keyfile-specify-key-or-key-pair-to-sign-an-assembly.md)

- [/NOASSEMBLY](noassembly-create-a-msil-module.md)
- [`/NOASSEMBLY`](noassembly-create-a-msil-module.md)

### 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](../working-with-project-properties.md).

1. Select the **Configuration Properties** > **Linker** > **Command Line** property page.

1. Type the option into the **Additional Options** box.
1. Enter the option in **Additional Options**. Choose **OK** or **Apply** to apply the change.

### To set this linker option programmatically

- See <xref:Microsoft.VisualStudio.VCProjectEngine.VCLinkerTool.AdditionalOptions%2A>.

## See also

[MSVC linker reference](linking.md)<br/>
[MSVC Linker Options](linker-options.md)
[MSVC linker reference](linking.md)\
[MSVC linker options](linker-options.md)
Loading