Skip to content

Commit 3e03442

Browse files
committed
Condition property on .NET FX MSBuild
The `BuildWithNetFrameworkHostedCompiler` property forces a .NET Framework specific compiler package to be used. This property was being unconditionally set which meant it loaded inside of `dotnet build`. In that environment the build task is invalid / unsupported. In this particular case the task ended up throwing errors trying to connect to the compiler server. That is an expected failure path in the build task and it will fallback silently to csc.exe. That meant this went unnoticed as builds remained functional, just significantly slower. Related: dotnet/sdk#48557
1 parent d59ce18 commit 3e03442

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Directory.Build.props

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,9 @@
7979
<NetPortableTargetFrameworks>$(NetCoreAppMinimum)</NetPortableTargetFrameworks>
8080
<NetRunnerTargetFrameworks>$(NetSDKTargetFramework);$(NetPortableTargetFrameworks)</NetRunnerTargetFrameworks>
8181
<RunnerTargetFrameworks>$(NetFrameworkRunnerTargetFramework);$(NetRunnerTargetFrameworks)</RunnerTargetFrameworks>
82-
82+
8383
<!--
84-
84+
8585
-->
8686
<BundledExtensionTargetFrameworks>$(RunnerTargetFrameworks)</BundledExtensionTargetFrameworks>
8787
<!--
@@ -112,7 +112,7 @@
112112
https://learn.microsoft.com/en-us/dotnet/standard/frameworks#supported-target-frameworks
113113
-->
114114
<TestHostAllTargetFrameworks>$(TestHostMinimumTargetFrameworks);net47;net471;net472;net48;net481</TestHostAllTargetFrameworks>
115-
115+
116116
<!--
117117
Library that is loaded by others and by us. We don't know where it will run (e.b. TranslationLayer),
118118
we need to support all frameworks from minimum, and also netstandard2.0.
@@ -134,7 +134,7 @@
134134
<!-- Default to all packages generating a corresponding symbol package -->
135135
<IncludeSymbols>true</IncludeSymbols>
136136
<!-- Workaround for AD0001 in analyzers with .NET 9. See https://github.com/dotnet/arcade/issues/14311 -->
137-
<BuildWithNetFrameworkHostedCompiler>true</BuildWithNetFrameworkHostedCompiler>
137+
<BuildWithNetFrameworkHostedCompiler Condition="'$(MSBuildRuntimeType)' == 'Full'">true</BuildWithNetFrameworkHostedCompiler>
138138
</PropertyGroup>
139139

140140
<!-- Sign config -->

0 commit comments

Comments
 (0)