Use core compiler on netfx hosts with toolset package#80631
Merged
jjonescz merged 2 commits intodotnet:mainfrom Oct 24, 2025
Merged
Use core compiler on netfx hosts with toolset package#80631jjonescz merged 2 commits intodotnet:mainfrom
jjonescz merged 2 commits intodotnet:mainfrom
Conversation
Open
3 tasks
Member
Author
|
@RikkiGibson @333fred @jaredpar @dotnet/roslyn-compiler for reviews, thanks |
333fred
approved these changes
Oct 22, 2025
jaredpar
approved these changes
Oct 24, 2025
RikkiGibson
reviewed
Oct 24, 2025
| Even on netfx hosts we want to use netcore compiler to be consistent with SDK's behavior since .NET 10. | ||
| The opt out is also the same as in SDK - setting RoslynCompilerType=Framework. | ||
| --> | ||
| <_UseRoslynBridgeTask Condition="'$(MSBuildRuntimeType)' != 'Core' and '$(RoslynCompilerType)' != 'Framework'">true</_UseRoslynBridgeTask> |
Member
There was a problem hiding this comment.
Is the user meant to be able to put <RoslynCompilerType>Framework</RoslynCompilerType> in their project, in addition to PackageReference to MS.Net.Compilers.Toolset, and expect the toolset compiler to run on framework?
Member
Author
There was a problem hiding this comment.
Yes. Although one needs to ensure it's put before the package props are imported (so putting inside Directory.Build.props would work; or manually before <Import Sdk> element; or just as /p: command-line arg, etc).
RikkiGibson
approved these changes
Oct 24, 2025
Member
RikkiGibson
left a comment
There was a problem hiding this comment.
LGTM, but, my brain starts melting when I try to actually understand msbuild code.
333fred
added a commit
to 333fred/roslyn
that referenced
this pull request
Oct 24, 2025
* upstream/main: (332 commits) Cache lambdas in analyzer driver (dotnet#80759) Add information for NuGet package version 4.14 (dotnet#80870) Add missing search keywords to VB Advanced options page Fix IDE0031 false positive when preprocessor directives are used in if statements (dotnet#80878) Use core compiler on netfx hosts with toolset package (dotnet#80631) Make string concat assert more precise (dotnet#80619) Extensions: address some diagnostic quality issues (dotnet#80827) Add note on traversal order for bound nodes (dotnet#80872) Ensure that locals at the top level of a constructor have the same safe-context as parameters (dotnet#80807) Fix handling of SymbolDisplayCompilerInternalOptions.UseArityForGenericTypes option for non-native symbol implementations (dotnet#80826) Update src/Analyzers/CSharp/Tests/UseCollectionInitializer/UseCollectionInitializerTests.cs Add IsValidContainingStatement check to prevent collection initializers in using declarations Add back old DocumentSpan constructor (dotnet#80864) Add tests verifying pointer types in type parameters require unsafe context (dotnet#80776) Add regression test for Interlocked.Exchange with nullable types (dotnet#80796) Add regression test for ParseAttributeArgumentList with invalid input (fixes dotnet#8699) (dotnet#80705) Add regression test for compiler crash with syntax error in indexer declaration (dotnet#80772) Add runtime NullReferenceException validation to foreach null iteration tests (dotnet#80839) Update MicrosoftBuildTasksCoreVersionForMetrics to 17.11.48 (dotnet#80812) Mark CS4009 error as a "build only" error. (dotnet#80698) ...
jjonescz
added a commit
to jjonescz/dotnet-sdk
that referenced
this pull request
Nov 11, 2025
Needed due to dotnet/roslyn#80631.
jjonescz
added a commit
that referenced
this pull request
Dec 2, 2025
…81344) Follow up on #80631. Validation: - Broken here: https://dev.azure.com/devdiv/DevDiv/_git/VS/pullrequest/689538 - With this PR fixed here: https://dev.azure.com/devdiv/DevDiv/_git/VS/pullrequest/689871
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves #80608.
Will need this test change in the SDK: dotnet/sdk#51192