Skip to content

Conversation

jaredpar
Copy link
Member

This changes the build to only respect
BuildWithNetFrameworkHostedCompiler on full framework msbuild. Without this guard customers can accidentally force the use of Microsoft.Net.Sdk.Compilers.Toolset on a core msbuild. That leads to runtime errors as the build tasks inside are .NET Framework specific. These errors tend to be silent as they are in the server connection code which will fall back to csc.exe invocation on error

This changes the build to only respect
BuildWithNetFrameworkHostedCompiler on full framework msbuild. Without
this guard customers can accidentally force the use of
Microsoft.Net.Sdk.Compilers.Toolset on a core msbuild. That leads to
runtime errors as the build tasks inside are .NET Framework specific.
These errors tend to be silent as they are in the server connection code
which will fall back to csc.exe invocation on error
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot wasn't able to review any files in this pull request.

Files not reviewed (1)
  • src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Sdk.Common.targets: Language not supported

@ghost ghost added Area-Infrastructure untriaged Request triage from a team member labels Apr 17, 2025
jaredpar added a commit to jaredpar/vstest that referenced this pull request Apr 17, 2025
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
@jaredpar jaredpar enabled auto-merge (squash) April 17, 2025 23:05
@jaredpar jaredpar merged commit 1d314fc into main Apr 18, 2025
41 checks passed
@jaredpar jaredpar deleted the dev/jaredpar/fix branch April 18, 2025 01:53
nohwnd pushed a commit to microsoft/vstest that referenced this pull request Apr 21, 2025
* 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

* pr feedback
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area-Infrastructure untriaged Request triage from a team member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants