Open ganeshnj opened 3 years ago
VS uses msbuild for building and it's works as expected Rider also have errors on build SDK-style projects with net35 targets
I've found deferent behaviors:
failed build:
success build:
I've found workaroud
set properties
<FrameworkPathOverride Condition="'$(TargetFramework)' == 'net35'">$(MSBuildProgramFiles32)\Reference Assemblies\Microsoft\Framework\.NETFramework\v3.5\Profile\Client</FrameworkPathOverride>
<AutomaticallyUseReferenceAssemblyPackages Condition=" '$(TargetFramework)' == 'net35' ">false</AutomaticallyUseReferenceAssemblyPackages>
It looks like that means $(MSBuildFrameworkToolsRoot) was evaluated to ''. That's normally set in Microsoft.NetFramework.CurrentVersion.props, but that wasn't imported because exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.NETFramework.props\ImportBefore')
(C:\Users\jangirg\AppData\Local\Microsoft\MSBuild\Current\Microsoft.NETFramework.props\ImportBefore
) evaluated to false. Not sure if that's supposed to exist or if one of those properties is set to the wrong value.
@Forgind Try to get a repro going. See what happens if we target netcoreapp3.1
Issue Description
Failed to build .NET Framework 3.5 targeted class library using .NET 5.0 SDK.
Steps to Reproduce
Output
Expected Behavior
This issues existed previously also which was mitigated using this workaround.
Actual Behavior
dotnet build
should build the project.Analysis
I suspect .NET 5 CLI introduces some breaking changes that causes this behavior. If I force 3.1 version of .NET Core SDK, build succeeds.
Branch fix-35-reference-assemblies
global.json
Versions & Configurations
Attach a binlog
msbuild.zip