Issue Description
Suppose there is a Main project reference a multi-targeting Lib project, and to every Lib project's target framework, there are other different projects and packages referenced by Lib. The result is build success but run fail.
The dependencies that copy to local are faulty.
Steps to Reproduce
I put a similar sample in sanmuru/MSBuild-bug.
Console(Main) project reference CoreLib(Lib) project with SetTargetFramework="TargetFramework=netstandard2.0".
CoreLib(Lib) project reference Net462UtilLib project and System.Text.Json package when targeting net462.
CoreLib(Lib) project reference NetStandard20UtilLib project and Newtonsoft.Json package when targeting netstandard2.0.
- Build result shows
Console(Main) project do reference the correct output assembly (and its dependencies) which from NetStandard20UtilLib project, but as well copy output assembly from Net462UtilLib project and System.Text.Json package instead of Newtonsoft.Json package to local.
Expected Behavior
No idea whether it is a feature or a bug, if it is a bug then fix it, or crash build process if it is a feature.
Versions & Configurations
.NET Runtime: 7.0.200-preview.22628.1
Issue Description
Suppose there is a
Mainproject reference a multi-targetingLibproject, and to everyLibproject's target framework, there are other different projects and packages referenced byLib. The result is build success but run fail.The dependencies that copy to local are faulty.
Steps to Reproduce
I put a similar sample in sanmuru/MSBuild-bug.
Console(Main) project referenceCoreLib(Lib) project withSetTargetFramework="TargetFramework=netstandard2.0".CoreLib(Lib) project referenceNet462UtilLibproject andSystem.Text.Jsonpackage when targetingnet462.CoreLib(Lib) project referenceNetStandard20UtilLibproject andNewtonsoft.Jsonpackage when targetingnetstandard2.0.Console(Main) project do reference the correct output assembly (and its dependencies) which fromNetStandard20UtilLibproject, but as well copy output assembly fromNet462UtilLibproject andSystem.Text.Jsonpackage instead ofNewtonsoft.Jsonpackage to local.Expected Behavior
No idea whether it is a feature or a bug, if it is a bug then fix it, or crash build process if it is a feature.
Versions & Configurations
.NET Runtime: 7.0.200-preview.22628.1