Skip to content

Specifying a framework for multi-targeted dependencies that include a .NET Framework target does not work. #35341

Closed as not planned
@orehmane

Description

@orehmane

Describe the bug

We have some projects that reference projects that are multi-targeted, including both 472 and 6.0. We're attempting to build them on Ubuntu, and so are specifying --framework net6.0 on the command line.

However, unless the reference is removed entirely, the dependency fails to build, with an error message saying that a 472 project is not compatible with 6.0.

To Reproduce

Build a project that has multitargeted dependencies, included as ProjectReferences, on Ubuntu, specifying net6.0 as the target framework.

Exceptions (if any)

Further technical details

  • Include the output of dotnet --info
 Version:   6.0.413
 Commit:    10710f7d8e

Runtime Environment:
 OS Name:     ubuntu
 OS Version:  22.04
 OS Platform: Linux
 RID:         ubuntu.22.04-x64
 Base Path:   /usr/share/dotnet/sdk/6.0.413/

global.json file:
  snip

Host:
  Version:      6.0.21
  Architecture: x64
  Commit:       e40b3abf1b

.NET SDKs installed:
  6.0.413 [/usr/share/dotnet/sdk]

.NET runtimes installed:
  [Microsoft.AspNetCore.App](http://microsoft.aspnetcore.app/) 6.0.21 [/usr/share/dotnet/shared/[Microsoft.AspNetCore.App](http://microsoft.aspnetcore.app/)]
  [Microsoft.NETCore.App](http://microsoft.netcore.app/) 6.0.21 [/usr/share/dotnet/shared/[Microsoft.NETCore.App](http://microsoft.netcore.app/)]

Download .NET:
  https://aka.ms/dotnet-download

Learn about .NET Runtimes and SDKs:
  https://aka.ms/dotnet/runtimes-sdk-info```

Metadata

Metadata

Assignees

Labels

needs team triageRequires a full team discussionuntriagedRequest triage from a team member

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions