Skip to content

Toolset compiler package on .NET Framework should use .NET Core compiler #80608

@jjonescz

Description

@jjonescz

Currently, building a project via Full Framework MSBuild uses the .NET Core version of the compiler via the "bridge" task (#77914). However, installing a compiler toolset package on such project switches to .NET Framework compiler. I think that should be fixed - the project can rely on core compiler by eg using netcore-targeting analyzers, and installing a toolset package shouldn't break that (toolset package is a means to ship hotfixes in the compiler binary but otherwise preserve the build's behavior).

Discovered while working on .NET Lab, this is my current workaround there:

https://github.com/jjonescz/DotNetLab/blob/4018c9adc3cba7b1ea17ba37fb9dc5be52b34abd/Directory.Build.targets#L3-L4

<!-- Force use of the Roslyn bridge task so the core compiler (from the toolset package) is used even on netfx hosts. -->
<RoslynTasksAssembly Condition="'$(MSBuildRuntimeType)' != 'Core'">$(_RoslynTasksDirectory)..\netcore\binfx\Microsoft.Build.Tasks.CodeAnalysis.Sdk.dll</RoslynTasksAssembly>

Metadata

Metadata

Assignees

Type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions