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
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).
686
685
@@ -847,24 +846,17 @@ The `DisableRuntimeMarshalling` property enables you to specify that you would l
847
846
848
847
### BuildWithNetFrameworkHostedCompiler
849
848
850
-
When using .NET Framework MSBuild, `BuildWithNetFrameworkHostedCompiler=true` ensures that
851
-
a C#/VB compiler corresponding to the current SDK version is used
852
-
instead of the default version that ships with MSBuild.
853
-
When this property is set to `true`, the .NET Framework version of the compiler is used, unlike `RoslynUseSdkCompiler`.
854
-
In some cases, this behavior happens automatically when it is detected that MSBuild and SDK versions are different,
855
-
and then you can set `BuildWithNetFrameworkHostedCompiler=false` to opt out of the behavior.
849
+
Specifying `BuildWithNetFrameworkHostedCompiler=true` is the equivalent of specifying `RoslynCompilerType=FrameworkPackage`. For more information, see [RoslynCompilerType](#roslyncompilertype).
850
+
Specifying `BuildWithNetFrameworkHostedCompiler=false` ensures the automatic opt in to `RoslynCompilerType=FrameworkPackage` does not happen.
851
+
If `RoslynCompilerType` is specified explicitly, `BuildWithNetFrameworkHostedCompiler` has no effect.
856
852
857
-
### RoslynUseSdkCompiler
853
+
### RoslynCompilerType
858
854
859
-
When using .NET Framework MSBuild, `RoslynUseSdkCompiler=true` ensures that
860
-
a C#/VB compiler corresponding to the current SDK version is used
861
-
instead of the default version that ships with MSBuild.
862
-
When this property is set to `true`, the .NET Core version of the compiler is used, unlike `BuildWithNetFrameworkHostedCompiler`.
863
-
In most cases, `RoslynUseSdkCompiler=true` is the default setting.
855
+
The `RoslynCompilerType` property controls the version of the C# or Visual Basic compiler. The following values are recognized:
864
856
865
-
### RoslynUseMSBuildCompiler
866
-
867
-
`RoslynUseMSBuildCompiler=true` can be used to opt out of an implicit `RoslynUseSdkCompiler=true`.
857
+
-`Core`: Use the compiler that comes with the .NET SDK. This is the default since .NET 10, even when using .NET Framework MSBuild.
858
+
-`Framework`: Use the compiler that comes with .NET Framework MSBuild.
859
+
-`FrameworkPackage`: When using .NET Framework MSBuild, download and use a package with the .NET Framework compiler that corresponds to the .NET SDK version.
0 commit comments