Skip to content

Repo sync for protected CLA branch #2560

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 21 commits into from
Oct 28, 2020
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
27 changes: 17 additions & 10 deletions docs/build/reference/clr-common-language-runtime-compilation.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
---
title: "/clr (Common Language Runtime compilation)"
description: "Use the Microsoft C++ compiler option /clr to compile C++/CLI and C++ code as managed code."
ms.date: 10/25/2020
ms.date: 10/27/2020
f1_keywords: ["/CLR", "VC.Project.VCNMakeTool.CompileAsManaged", "VC.Project.VCCLCompilerTool.CompileAsManaged"]
helpviewer_keywords: ["cl.exe compiler, common language runtime option", "-clr compiler option [C++]", "clr compiler option [C++]", "/clr compiler option [C++]", "Managed Extensions for C++, compiling", "common language runtime, /clr compiler option"]
ms.assetid: fec5a8c0-40ec-484c-a213-8dec918c1d6c
---
# `/clr` (Common Language Runtime Compilation)

Enables applications and components to use features from the common language runtime (CLR).
Enables applications and components to use features from the common language runtime (CLR) and enables C++/CLI compilation.

## Syntax

Expand All @@ -21,7 +21,15 @@ One or more of the following comma-separated arguments.

- none

With no options, **`/clr`** creates metadata for the application. The metadata can be consumed by other CLR applications, and enables the application to consume types and data in the metadata of other CLR components. For more information, see [Mixed (Native and Managed) Assemblies](../../dotnet/mixed-native-and-managed-assemblies.md).
With no options, **`/clr`** creates metadata for the component. The metadata can be consumed by other CLR applications, and enables the component to consume types and data in the metadata of other CLR components. For more information, see [Mixed (Native and Managed) Assemblies](../../dotnet/mixed-native-and-managed-assemblies.md).

- **`NetCore`**

**`/clr:NetCore`** creates metadata and code for the component using the latest cross-platform .NET framework, also known as .NET Core. The metadata can be consumed by other .NET Core applications. And, the option enables the component to consume types and data in the metadata of other .NET Core components.

- **`nostdlib`**

Instructs the compiler to ignore the default *`\clr`* directory. The compiler produces errors if you include multiple versions of a DLL, such as System.dll. This option lets you specify the specific framework to use during compilation.

- **`pure`**

Expand All @@ -43,15 +51,11 @@ One or more of the following comma-separated arguments.

- **`initialAppDomain`**

Enables a C++/CLI application to run on version 1 of the CLR. An application that's compiled by using **`initialAppDomain`** shouldn't be used by an application that uses ASP.NET because it's not supported in version 1 of the CLR.

- **`nostdlib`**

Instructs the compiler to ignore the default *`\clr`* directory. The compiler produces errors if you include multiple versions of a DLL, such as System.dll. This option lets you specify the specific framework to use during compilation.
**`initialAppDomain` is obsolete**. Enables a C++/CLI application to run on version 1 of the CLR. An application that's compiled by using **`initialAppDomain`** shouldn't be used by an application that uses ASP.NET because it's not supported in version 1 of the CLR.

## Remarks

Managed code is code that can be inspected and managed by the CLR. Managed code can access managed objects. For more information, see [`/clr `Restrictions](clr-restrictions.md).
*Managed code* is code that can be inspected and managed by the CLR. Managed code can access managed objects. For more information, see [`/clr` Restrictions](clr-restrictions.md).

For information about how to develop applications that define and consume managed types in C++, see [Component Extensions for Runtime Platforms](../../extensions/component-extensions-for-runtime-platforms.md).

Expand Down Expand Up @@ -95,10 +99,13 @@ Use ildasm.exe to view metadata.

1. Set the **Configuration** dropdown to **All configurations**, and set the **Platform** dropdown to **All Platforms**.

1. Select the **Configuration Properties** > **Advanced** page.
1. Select the **Configuration Properties** > **C/C++** > **General** page.

1. Modify the **Common Language Runtime Support** property. Choose **OK** to save your changes.

> [!NOTE]
> In the Visual Studio IDE, the **`/clr`** compiler option can be individually set on the **Configuration Properties** > **C/C++** > **General** page of the Property Pages dialog. However, we recommend you use a CLR template to create your project. It sets all of the properties required for successful creation of a CLR component. Another way to set these properties is to use the **Common Language Runtime Support** property on the **Configuration Properties** > **Advanced** page of the Property Pages dialog. This property sets all the other CLR-related tool options at once.

### To set this compiler option programmatically

- See <xref:Microsoft.VisualStudio.VCProjectEngine.VCCLCompilerTool.CompileAsManaged>.
Expand Down
15 changes: 8 additions & 7 deletions docs/build/reference/custom-build-step-property-page-general.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
---
title: "Custom Build Step Property Page: General"
ms.date: "11/04/2016"
description: "This article describes the properties available on the Custom Build Step page in the Property Pages dialog."
ms.date: 10/27/2020
f1_keywords: ["VC.Project.VCCustomBuildStep.AdditionalInputs", "VC.Project.VCCustomBuildStep.CustomBuildAfterTargets", "VC.Project.VCCustomBuildStep.CustomBuildBeforeTargets", "VC.Project.VCCustomBuildStep.Outputs", "VC.Project.VCCustomBuildStep.Message", "VC.Project.VCCustomBuildStep.Command"]
helpviewer_keywords: ["project properties, custom build step", "custom build step (general)"]
ms.assetid: bd319741-0491-46c4-a428-7c61b4b46a02
---
# Custom Build Step Property Page: General

For each combination of project configuration and target platform in your project, you can specify a custom step to be performed when the project is built.
For each project configuration and target platform combination in your project, you can specify a custom step to execute when the project is built.

For the Linux version of this page, see [Custom Build Step Properties (Linux C++)](../../linux/prop-pages/custom-build-step-linux.md).

## UIElement List
## General page

- **Command Line**

Expand All @@ -31,17 +32,17 @@ For the Linux version of this page, see [Custom Build Step Properties (Linux C++

- **Execute After and Execute Before**

These options define when the custom build step is run in the build process, relative to the listed targets. The most commonly listed targets are BuildGenerateSources, BuildCompile, and BuildLink, because they represent the major steps in the build process. Other often-listed targets are Midl, CLCompile, and Link.
These options define when the custom build step is run in the build process, relative to the listed targets. The most commonly listed targets are `BuildGenerateSources`, `BuildCompile`, and `BuildLink`, because they represent the major steps in the build process. Other often-listed targets are `Midl`, `CLCompile`, and `Link`.

- **Treat Output As Content**

This option is only meaningful for Universal Windows Platform or Windows Phone apps, which include all content files in the .appx package.
This option is only meaningful for Universal Windows Platform or Windows Phone apps, which include all content files in the *`.appx`* package.

### To specify a custom build step

1. On the menu bar, choose **Project**, **Properties**. For more information, see [Set C++ compiler and build properties in Visual Studio](../working-with-project-properties.md).
1. On the menu bar, choose **Project** > **Properties**. For more information, see [Set C++ compiler and build properties in Visual Studio](../working-with-project-properties.md).

1. In the **Property Pages** dialog box, navigate to the **Configuration Properties**, **Custom Build Step**, **General** page.
1. In the **Property Pages** dialog box, navigate to the **Configuration Properties** > **Custom Build Step** > **General** page.

1. Modify the settings.

Expand Down
Loading