Skip to content

Building net*-android apps always restore Microsoft.NETCore.App.Host.linux #25679

Closed
@jonathanpeppers

Description

@jonathanpeppers

Describe the bug

> dotnet new android
> dotnet restore

Appears to always download:

image

This is related to: #19891

Since these are on NuGet.org, everything works.

However, we started noticing this with net7.0-android apps:

image

Since these are not on NuGet, you get errors like:

Errors
    C:\src\foo\foo.csproj error NU1102: Unable to find package Microsoft.NETCore.App.Host.linux-arm with version (= 7.0.0-preview.5.22271.4)
  - Found 88 version(s) in nuget.org [ Nearest version: 7.0.0-preview.4.22229.4 ]
  - Found 0 version(s) in Microsoft Visual Studio Offline Packages [C:\src\foo\foo.csproj]
    C:\src\foo\foo.csproj error NU1102: Unable to find package Microsoft.NETCore.App.Host.linux-arm64 with version (= 7.0.0-preview.5.22271.4)
  - Found 88 version(s) in nuget.org [ Nearest version: 7.0.0-preview.4.22229.4 ]
  - Found 0 version(s) in Microsoft Visual Studio Offline Packages [C:\src\foo\foo.csproj]
    C:\src\foo\foo.csproj error NU1102: Unable to find package Microsoft.NETCore.App.Host.linux-x64 with version (= 7.0.0-preview.5.22271.4)
  - Found 88 version(s) in nuget.org [ Nearest version: 7.0.0-preview.4.22229.4 ]
  - Found 0 version(s) in Microsoft Visual Studio Offline Packages [C:\src\foo\foo.csproj]

And so anyone dogfooding .NET 7 would have to add a nuget.config:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <packageSources>
    <add key="dotnet7" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet7/nuget/v3/index.json" />
  </packageSources>
</configuration>

To Reproduce

  1. Install the .NET 7 android workload
  2. dotnet new android
  3. dotnet restore

Exceptions (if any)

Binlog: msbuild.zip

Further technical details

.NET SDK:
 Version:   7.0.100-preview.5.22273.1
 Commit:    a3acdcf34e

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.19044
 OS Platform: Windows
 RID:         win10-x64
 Base Path:   C:\src\xamarin-android\bin\Release\dotnet\sdk\7.0.100-preview.5.22273.1\

global.json file:
  Not found

Host:
  Version:      7.0.0-preview.5.22271.4
  Architecture: x64
  Commit:       621cd59436

.NET SDKs installed:
  7.0.100-preview.5.22273.1 [C:\src\xamarin-android\bin\Release\dotnet\sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 7.0.0-preview.5.22272.3 [C:\src\xamarin-android\bin\Release\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 7.0.0-preview.5.22271.4 [C:\src\xamarin-android\bin\Release\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.WindowsDesktop.App 7.0.0-preview.5.22269.1 [C:\src\xamarin-android\bin\Release\dotnet\shared\Microsoft.WindowsDesktop.App]

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions