-
Notifications
You must be signed in to change notification settings - Fork 265
Closed
Description
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
- Install:
- .NET 5 (specific build): https://dotnetcli.azureedge.net/dotnet/Sdk/5.0.100-rtm.20509.5/dotnet-sdk-5.0.100-rtm.20509.5-osx-x64.pkg
- Android workload: https://dl.internalx.com/vsts-devdiv/Xamarin.Android/public/4179834/master/68be8d810e3f87865d88467ae593048297bf3e60/Microsoft.NET.Workload.Android-11.0.100-ci.master.206.pkg
- iOS workload: https://bosstoragemirror.blob.core.windows.net/wrench/jenkins/main/923aef0838a64d7c2886716806c669d107fa399b/467/package/Microsoft.iOS.Bundle.14.1.100-ci.main.27.pkg
- Clone, and build the
peppers/workloadbranch:
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