Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[net7-rc2] Unable to find package Microsoft.NETCore.App.Runtime.linux-bionic-x64 with version (= 6.0.10) #16401

Closed
jeromelaban opened this issue Oct 20, 2022 · 6 comments
Labels
macOS Issues affecting Xamarin.Mac question The issue is a question
Milestone

Comments

@jeromelaban
Copy link
Contributor

Steps to Reproduce

I'm opening this issue in this repository because it seems related to the restore graph generation in net6.0-macos.

I'm also not sure about the repro steps, but here we go:

  1. Install net7.0-rc2 with all workloads (including macos)
  2. dotnet new install Uno.ProjectTemplates.Dotnet
  3. dotnet new unoapp -o testapp
  4. cd testapp\testapp.Mobile
  5. dotnet build -f net6.0-android -c Release -p:RuntimeIdentifier=android-x64

(Android is on purpose here, because that's how the issue seems to happen, but it may not be the trigger)

Expected Behavior

Compilation succeeds.

Actual Behavior

/Users/runner/work/1/s/src/SamplesApp/SamplesApp.netcoremobile/SamplesApp.netcoremobile.csproj error NU1102: Unable to find package Microsoft.NETCore.App.Runtime.linux-bionic-x64 with version (= 6.0.10)
  - Found 5 version(s) in NuGet official package source [ Nearest version: 7.0.0-preview.5.22301.12 ]
  - Found 0 version(s) in Solution Packages
  - Found 0 version(s) in platform.uno dev [/Users/runner/work/1/s/src/SamplesApp/SamplesApp.netcoremobile/SamplesApp.netcoremobile.csproj]

Environment

dotnet --version
7.0.100-rc.2.22477.23
dotnet workload list
Installed Workload Id      Manifest Version                         Installation Source
---------------------------------------------------------------------------------------
macos                      12.3.1186-rc.2/7.0.100-rc.2              SDK 7.0.100-rc.2
ios                        16.0.1271-rc.2-xcode14/7.0.100-rc.2      VS 17.4.33015.44
maui-android               7.0.0-rc.2.6866/7.0.100-rc.2             VS 17.4.33015.44
maui-windows               7.0.0-rc.2.6866/7.0.100-rc.2             VS 17.4.33015.44
maui-maccatalyst           7.0.0-rc.2.6866/7.0.100-rc.2             VS 17.4.33015.44
android                    33.0.0-rc.2.202/7.0.100-rc.2             VS 17.4.33015.44
maccatalyst                15.4.1186-rc.2/7.0.100-rc.2              VS 17.4.33015.44
maui-ios                   7.0.0-rc.2.6866/7.0.100-rc.2             VS 17.4.33015.44

Build Logs

android-netcoremobile-sampleapp.zip

@rolfbjarne
Copy link
Member

rolfbjarne commented Oct 20, 2022

Did you get a binlog for this issue? Your binlog said "sampleapp" and that confused me 😄

@jeromelaban
Copy link
Contributor Author

Heh ;) Yes it's Uno's sample app build logs.

As an update, if I remove net6.0-macos from the TargetFramework list, the nuget restore graph is generated properly.

@dalexsoto dalexsoto added question The issue is a question macOS Issues affecting Xamarin.Mac labels Oct 21, 2022
@dalexsoto dalexsoto added this to the Future milestone Oct 21, 2022
@jeromelaban
Copy link
Contributor Author

jeromelaban commented Oct 24, 2022

@dalexsoto If this issue is tagged future, does this mean it won't be fixed for .NET 7.0.100? If that's the case, this means we'll need to remove all the macos targets frameworks everywhere?

@rolfbjarne
Copy link
Member

@jeromelaban I believe this issue will "fix" itself once the package it's complaining about is released.

That doesn't mean there's an issue here (it's certainly weird - and kind of amusing... - that it's complaining about a linux package when building for android, but only when macOS is among the target frameworks).

@rolfbjarne
Copy link
Member

rolfbjarne commented Oct 25, 2022

Minimal repro project:

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <TargetFrameworks>net6.0-android;net6.0-macos</TargetFrameworks>
    <OutputType>Exe</OutputType>
  </PropertyGroup>
</Project>

Fails like this:

$ dotnet build -f net6.0-android -c Release -p:RuntimeIdentifier=android-x64
MSBuild version 17.4.0-preview-22465-02+02b334e3a for .NET
  Determining projects to restore...
/Users/rolf/test/dotnet/issue-16401-a/testapp/testapp.Mobile/testapp.Mobile.csproj : error NU1102: Unable to find package Microsoft.NETCore.App.Runtime.linux-bionic-x64 with version (= 6.0.10)
/Users/rolf/test/dotnet/issue-16401-a/testapp/testapp.Mobile/testapp.Mobile.csproj : error NU1102:   - Found 5 version(s) in nuget.org [ Nearest version: 7.0.0-preview.5.22301.12 ]
/Users/rolf/test/dotnet/issue-16401-a/testapp/testapp.Mobile/testapp.Mobile.csproj : error NU1102:   - Found 0 version(s) in /usr/local/share/dotnet/library-packs
  Failed to restore /Users/rolf/test/dotnet/issue-16401-a/testapp/testapp.Mobile/testapp.Mobile.csproj (in 109 ms).

Note that specifying the RuntimeIdentifier on the command line is required to reproduce.

In fact you get the same error if you try to build the net6.0-macos framework with the android RuntimeIdentifier:

$ dotnet build -f net6.0-macos -c Release -p:RuntimeIdentifier=android-x64
MSBuild version 17.4.0-preview-22465-02+02b334e3a for .NET
  Determining projects to restore...
/Users/rolf/test/dotnet/issue-16401-a/testapp/testapp.Mobile/testapp.Mobile.csproj : error NU1102: Unable to find package Microsoft.NETCore.App.Runtime.linux-bionic-x64 with version (= 6.0.10)
/Users/rolf/test/dotnet/issue-16401-a/testapp/testapp.Mobile/testapp.Mobile.csproj : error NU1102:   - Found 5 version(s) in nuget.org [ Nearest version: 7.0.0-preview.5.22301.12 ]
/Users/rolf/test/dotnet/issue-16401-a/testapp/testapp.Mobile/testapp.Mobile.csproj : error NU1102:   - Found 0 version(s) in /usr/local/share/dotnet/library-packs
  Failed to restore /Users/rolf/test/dotnet/issue-16401-a/testapp/testapp.Mobile/testapp.Mobile.csproj (in 109 ms).

Which makes me think this is a variation of dotnet/sdk#21877, where the RuntimeIdentifier specified on the command line is used for all target frameworks during the restore operation.

This also means there's a workaround: don't specify the RuntimeIdentifier on the command line, but in the project file instead:

<RuntimeIdentifier Condition="'$(TargetFramework)' == 'net6.0-android'">android-x64</RuntimeIdentifier>

@rolfbjarne
Copy link
Member

Closing as duplicate of dotnet/sdk#21877.

@rolfbjarne rolfbjarne closed this as not planned Won't fix, can't repro, duplicate, stale Oct 25, 2022
@ghost ghost locked as resolved and limited conversation to collaborators Nov 25, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
macOS Issues affecting Xamarin.Mac question The issue is a question
Projects
None yet
Development

No branches or pull requests

3 participants