Skip to content

Conversation

jaredpar
Copy link
Member

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

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
<IncludeSymbols>true</IncludeSymbols>
<!-- Workaround for AD0001 in analyzers with .NET 9. See https://github.com/dotnet/arcade/issues/14311 -->
<BuildWithNetFrameworkHostedCompiler>true</BuildWithNetFrameworkHostedCompiler>
<BuildWithNetFrameworkHostedCompiler Condition="'$(MSBuildRuntimeType)' == 'Full'">true</BuildWithNetFrameworkHostedCompiler>
Copy link
Member

@ViktorHofer ViktorHofer Apr 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We shouldn't be setting this property in vstest anymore. That was only necessary for a short period of time during .NET 9. Please also remove the comment above. GH doesn't let me do that.

Suggested change
<BuildWithNetFrameworkHostedCompiler Condition="'$(MSBuildRuntimeType)' == 'Full'">true</BuildWithNetFrameworkHostedCompiler>

@Youssef1313 Youssef1313 requested a review from nohwnd April 19, 2025 13:23
@nohwnd nohwnd merged commit 1fc2bc7 into microsoft:main Apr 21, 2025
7 checks passed
This was referenced Oct 2, 2025
This was referenced Oct 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants