Skip to content

Multitargeted iOS/Android - Duplicate frameworks found: 'net5.0, net5.0' #10195

@jonathanpeppers

Description

@jonathanpeppers

Details about Problem

A multi-targed iOS/Android project:

<TargetFrameworks>net5.0-android;net5.0-ios</TargetFrameworks>

dotnet build fails with:

/Users/runner/.dotnet/sdk/5.0.100-rtm.20509.5/NuGet.targets(131,5): Invalid restore input. Duplicate frameworks found: 'net5.0, net5.0'. Input files: /Users/runner/work/1/s/HelloForms/HelloForms.csproj. [/Users/runner/work/1/s/net6-samples.sln]
NuGet.Commands.RestoreSpecException: Invalid restore input. Duplicate frameworks found: 'net5.0, net5.0'. Input files: /Users/runner/work/1/s/HelloForms/HelloForms.csproj.
   at NuGet.Commands.SpecValidationUtility.ValidateFrameworks(PackageSpec spec, IEnumerable`1 files)
   at NuGet.Commands.SpecValidationUtility.ValidateProjectSpecPackageReference(PackageSpec spec, IEnumerable`1 files)
   at NuGet.Commands.SpecValidationUtility.ValidateProjectSpec(PackageSpec spec)
   at NuGet.Commands.SpecValidationUtility.ValidateDependencySpec(DependencyGraphSpec spec, HashSet`1 projectsToSkip)
   at NuGet.Commands.DependencyGraphSpecRequestProvider.GetRequestsFromItems(RestoreArgs restoreContext, DependencyGraphSpec dgFile)
   at NuGet.Commands.DependencyGraphSpecRequestProvider.CreateRequests(RestoreArgs restoreContext)
   at NuGet.Commands.RestoreRunner.CreatePreLoadedRequests(RestoreArgs restoreContext)
   at NuGet.Commands.RestoreRunner.GetRequests(RestoreArgs restoreContext)
   at NuGet.Commands.RestoreRunner.RunAsync(RestoreArgs restoreContext, CancellationToken token)
   at NuGet.Build.Tasks.BuildTasksUtility.RestoreAsync(DependencyGraphSpec dependencyGraphSpec, Boolean interactive, Boolean recursive, Boolean noCache, Boolean ignoreFailedSources, Boolean disableParallel, Boolean force, Boolean forceEvaluate, Boolean hideWarningsAndErrors, Boolean restorePC, Boolean cleanupAssetsForUnsupportedProjects, ILogger log, CancellationToken cancellationToken)
   at NuGet.Build.Tasks.RestoreTask.ExecuteAsync(ILogger log)

NuGet product used (NuGet.exe | VS UI | Package Manager Console | dotnet.exe): dotnet

NuGet version (x.x.x.xxx): .NET 5.0.100-rtm.20509.5

dotnet.exe --version (if appropriate): 5.0.100-rtm.20509.5

OS version (i.e. win10 v1607 (14393.321)): macOS 10.15.7 (macOS-latest image on Azure DevOps)

Worked before? If so, with which NuGet version:

It works on my local Mac, but not on Azure DevOps.

Detailed repro steps so we can see the same problem

Context: dotnet/maui-samples#39

  1. Install:
  1. Clone, and build the peppers/workload branch:

https://github.com/xamarin/net6-samples

dotnet build

Other suggested things

Verbose Logs

Attached a failing vs working .binlog: logs.zip

Sample Project

https://github.com/xamarin/net6-samples - the peppers/workload branch.

/cc @dsplaisted

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions