Skip to content

dotnet workload restore - Source array was not long enough #46130

Closed
@krwq

Description

@krwq

Describe the bug / Repro

I'm trying to build dotnet new android project which was generated using net9 and changed TargetFramework to net10.0-android. When I built I got following error:

To build this project, the following workloads must be installed: wasi-experimental
To install these workloads, run the following command: dotnet workload restore

When running dotnet workload restore on that project I'm getting another error:

Installation rollback failed: Source array was not long enough. Check the source index, length, and the array's lower bounds. (Parameter 'sourceArray')
Workload update failed: Source array was not long enough. Check the source index, length, and the array's lower bounds. (Parameter 'sourceArray')

Further technical details

  • Include the output of dotnet --info
.NET SDK:
 Version:           10.0.100-alpha.1.25070.1
 Commit:            01596b3b83
 Workload version:  10.0.100-manifests.f9555443
 MSBuild version:   17.14.0-preview-25067-08+c81c498d4

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.26100
 OS Platform: Windows
 RID:         win-x64
 Base Path:   C:\Program Files\dotnet\sdk\10.0.100-alpha.1.25070.1\

.NET workloads installed:
 [aspire]
   Installation Source: VS 17.14.35717.212
   Manifest Version:    8.2.2/8.0.100
   Manifest Path:       C:\Program Files\dotnet\sdk-manifests\8.0.100\microsoft.net.sdk.aspire\8.2.2\WorkloadManifest.json
   Install Type:              Msi

 [maui-windows]
   Installation Source: VS 17.14.35717.212
   Manifest Version:    9.0.14/9.0.100
   Manifest Path:       C:\Program Files\dotnet\sdk-manifests\9.0.100\microsoft.net.sdk.maui\9.0.14\WorkloadManifest.json
   Install Type:              Msi

 [maccatalyst]
   Installation Source: VS 17.14.35717.212
   Manifest Version:    18.2.9173/9.0.100
   Manifest Path:       C:\Program Files\dotnet\sdk-manifests\9.0.100\microsoft.net.sdk.maccatalyst\18.2.9173\WorkloadManifest.json
   Install Type:              Msi

 [ios]
   Installation Source: VS 17.14.35717.212
   Manifest Version:    18.2.9173/9.0.100
   Manifest Path:       C:\Program Files\dotnet\sdk-manifests\9.0.100\microsoft.net.sdk.ios\18.2.9173\WorkloadManifest.json
   Install Type:              Msi

 [android]
   Installation Source: VS 17.14.35717.212
   Manifest Version:    35.0.39/9.0.100
   Manifest Path:       C:\Program Files\dotnet\sdk-manifests\9.0.100\microsoft.net.sdk.android\35.0.39\WorkloadManifest.json
   Install Type:              Msi

Configured to use loose manifests when installing new manifests.

Host:
  Version:      10.0.0-alpha.1.25068.1
  Architecture: x64
  Commit:       29013d8ae5

.NET SDKs installed:
  3.1.426 [C:\Program Files\dotnet\sdk]
  6.0.321 [C:\Program Files\dotnet\sdk]
  6.0.428 [C:\Program Files\dotnet\sdk]
  7.0.410 [C:\Program Files\dotnet\sdk]
  8.0.112 [C:\Program Files\dotnet\sdk]
  9.0.200-preview.0.25057.12 [C:\Program Files\dotnet\sdk]
  10.0.100-alpha.1.25070.1 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 3.1.32 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 6.0.26 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 6.0.36 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 7.0.20 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 8.0.11 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 8.0.12 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 9.0.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 10.0.0-alpha.2.25068.1 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 3.1.32 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 6.0.26 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 6.0.36 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 7.0.20 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 8.0.11 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 8.0.12 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 9.0.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 10.0.0-alpha.1.25068.1 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.WindowsDesktop.App 3.1.32 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 6.0.26 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 6.0.36 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 7.0.20 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 8.0.11 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 8.0.12 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 9.0.0 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 10.0.0-alpha.1.25067.6 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

Other architectures found:
  x86   [C:\Program Files (x86)\dotnet]
    registered at [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\x86\InstallLocation]

Environment variables:
  Not set

global.json file:
  Not found

Learn more:
  https://aka.ms/dotnet/info

Download .NET:
  https://aka.ms/dotnet/download
  • The IDE (VS / VS Code/ VS4Mac) you're running on, and its version

VS (first error only, second error was from command line):

17.14.0 Preview 1.0 [35717.212.main]

Activity

ericstj

ericstj commented on Jan 21, 2025

@ericstj
Member

@joeloff @marcpopMSFT seems to be the same as #45632. Is workload installation broken in 10.0?

marcpopMSFT

marcpopMSFT commented on Jan 28, 2025

@marcpopMSFT
Member

Workloads should be working in 10 now though I don't know if all of the maui side baselines have been updated yet. @jonathanpeppers

jonathanpeppers

jonathanpeppers commented on Jan 28, 2025

@jonathanpeppers
Member

We could update .NET 10 baselines, when we branch for preview 1. They wouldn't be the "final" ones, but that might improve things for now?

Note the Android workload listed above does not support .NET 10:

 [android]
   Installation Source: VS 17.14.35717.212
   Manifest Version:    35.0.39/9.0.100
Forgind

Forgind commented on Jan 29, 2025

@Forgind
Member

I technically used a slightly different version of the SDK (current main), but I had a quite different experience:

Image

Maybe there's a difference if I can find that package? But I'm not sure where to find that, as it isn't on nuget.org, as far as I can tell.

added this to the Discussion milestone on Feb 4, 2025
akoeplinger

akoeplinger commented on Feb 9, 2025

@akoeplinger
Member

Fixed by #46653

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions

    dotnet workload restore - Source array was not long enough · Issue #46130 · dotnet/sdk