Skip to content

Resolved project and package references in some cases are faulty #8405

@sanmuru

Description

@sanmuru

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

Metadata

Metadata

Assignees

Labels

Priority:2Work that is important, but not critical for the releaseauthor-respondedAuthor responded, needs response from dev team.bugneeds-triageHave yet to determine what bucket this goes in.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions