diff --git a/docs/core/project-sdk/msbuild-props.md b/docs/core/project-sdk/msbuild-props.md index 41e85958e4305..111bad198a0fa 100644 --- a/docs/core/project-sdk/msbuild-props.md +++ b/docs/core/project-sdk/msbuild-props.md @@ -678,6 +678,9 @@ The following MSBuild properties are documented in this section: - [GenerateRequiresPreviewFeaturesAttribute](#generaterequirespreviewfeaturesattribute) - [OptimizeImplicitlyTriggeredBuild](#optimizeimplicitlytriggeredbuild) - [DisableRuntimeMarshalling](#disableruntimemarshalling) +- [BuildWithNetFrameworkHostedCompiler](#buildwithnetframeworkhostedcompiler) +- [RoslynUseSdkCompiler](#roslynusesdkcompiler) +- [RoslynUseMSBuildCompiler](#roslynusemsbuildcompiler) C# compiler options, such as `LangVersion` and `Nullable`, can also be specified as MSBuild properties in your project file. For more information, see [C# compiler options](../../csharp/language-reference/compiler-options/index.md). @@ -842,6 +845,27 @@ The `DisableRuntimeMarshalling` property enables you to specify that you would l ``` +### BuildWithNetFrameworkHostedCompiler + +When using .NET Framework MSBuild, `BuildWithNetFrameworkHostedCompiler=true` ensures that +a C#/VB compiler corresponding to the current SDK version is used +instead of the default version that ships with MSBuild. +When this property is set to `true`, the .NET Framework version of the compiler is used, unlike `RoslynUseSdkCompiler`. +In some cases, this behavior happens automatically when it is detected that MSBuild and SDK versions are different, +and then you can set `BuildWithNetFrameworkHostedCompiler=false` to opt out of the behavior. + +### RoslynUseSdkCompiler + +When using .NET Framework MSBuild, `RoslynUseSdkCompiler=true` ensures that +a C#/VB compiler corresponding to the current SDK version is used +instead of the default version that ships with MSBuild. +When this property is set to `true`, the .NET Core version of the compiler is used, unlike `BuildWithNetFrameworkHostedCompiler`. +In most cases, `RoslynUseSdkCompiler=true` is the default setting. + +### RoslynUseMSBuildCompiler + +`RoslynUseMSBuildCompiler=true` can be used to opt out of an implicit `RoslynUseSdkCompiler=true`. + ## Default item inclusion properties The following MSBuild properties are documented in this section: