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).
683
686
@@ -842,6 +845,27 @@ The `DisableRuntimeMarshalling` property enables you to specify that you would l
842
845
</PropertyGroup>
843
846
```
844
847
848
+
### BuildWithNetFrameworkHostedCompiler
849
+
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.
856
+
857
+
### RoslynUseSdkCompiler
858
+
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.
864
+
865
+
### RoslynUseMSBuildCompiler
866
+
867
+
`RoslynUseMSBuildCompiler=true` can be used to opt out of an implicit `RoslynUseSdkCompiler=true`.
868
+
845
869
## Default item inclusion properties
846
870
847
871
The following MSBuild properties are documented in this section:
0 commit comments