dotnet / sdk

Core functionality needed to create .NET Core projects, that is shared between Visual Studio and CLI
https://dot.net/core
MIT License
2.73k stars 1.07k forks source link

Sometime multiple workload restores are required #28609

Open SimonCropp opened 2 years ago

SimonCropp commented 2 years ago

sometime i need to run dotnet workload restore multiple times to get all the workloads

Scenario

Note i am using Rider EAP:

JetBrains Rider 2022.3 EAP 3
Build #RD-223.6160.184, built on October 9, 2022
Licensed to JetBrains Rider EAP user: SimonC
Expiration date: November 8, 2022
Runtime version: 17.0.4.1+1-b629.2 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Windows 11 10.0
.NET 6.0.8 (Server GC)
GC: G1 Young Generation, G1 Old Generation
Memory: 1500M
Cores: 24
Registry:
    ide.experimental.ui=true
    indexing.enable.entity.provider.based.indexing=false
    ide.new.project.model.index.case.sensitivity=true
    vcs.empty.toolwindow.show=false
    rdclient.asyncActions=false
    node_modules.use.workspace.model=false
    ide.workspace.model.rbs.as.tree=false

But i have also had this happen with the previous stable version of Rider

Solution

https://github.com/getsentry/sentry-dotnet

dotnet workload restoreoutput:

Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.

Install the latest PowerShell for new features and improvements! https://aka.ms/PSWindows

PS D:\Code\sentry-dotnet> dotnet workload restore

Welcome to .NET 6.0!
---------------------
SDK Version: 6.0.402

Telemetry
---------
The .NET tools collect usage data in order to help us improve your experience. It is collected by Microsoft and shared with the community. You can opt-out of telemetry by setting the DOTNET_CLI_TELEMETRY_OPTOUT environment variable to '1' or 'true' using your favorite shell.

Read more about .NET CLI Tools telemetry: https://aka.ms/dotnet-cli-telemetry

----------------
Installed an ASP.NET Core HTTPS development certificate.
To trust the certificate run 'dotnet dev-certs https --trust' (Windows and macOS only).
Learn about HTTPS: https://aka.ms/dotnet-https
----------------
Write your first app: https://aka.ms/dotnet-hello-world
Find out what's new: https://aka.ms/dotnet-whats-new
Explore documentation: https://aka.ms/dotnet-docs
Report issues and find source on GitHub: https://github.com/dotnet/core
Use 'dotnet --help' to see available commands or visit: https://aka.ms/dotnet-cli
--------------------------------------------------------------------------------------
Installing workloads: macos ios maccatalyst

Downloading microsoft.net.sdk.android.manifest-6.0.400.msi.x64 (32.0.476)
Installing Microsoft.NET.Sdk.Android.Manifest-6.0.400.32.0.476-x64.msi .... Done
Downloading microsoft.net.sdk.ios.manifest-6.0.400.msi.x64 (16.0.517)
Installing Microsoft.NET.Sdk.iOS.Manifest-6.0.400.16.0.517-x64.msi .... Done
Downloading microsoft.net.sdk.maccatalyst.manifest-6.0.400.msi.x64 (15.4.465)
Installing Microsoft.NET.Sdk.MacCatalyst.Manifest-6.0.400.15.4.465-x64.msi .... Done
Downloading microsoft.net.sdk.macos.manifest-6.0.400.msi.x64 (12.3.465)
Installing Microsoft.NET.Sdk.macOS.Manifest-6.0.400.12.3.465-x64.msi .... Done
Downloading microsoft.net.sdk.maui.manifest-6.0.400.msi.x64 (6.0.541)
Installing Microsoft.NET.Sdk.Maui.Manifest-6.0.400.6.0.541-x64.msi .... Done
Downloading microsoft.net.sdk.tvos.manifest-6.0.400.msi.x64 (16.0.517)
Installing Microsoft.NET.Sdk.tvOS.Manifest-6.0.400.16.0.517-x64.msi .... Done
Downloading microsoft.net.workload.mono.toolchain.manifest-6.0.400.msi.x64 (6.0.10)
Installing Microsoft.NET.Workload.Mono.ToolChain.Manifest-6.0.400.6.0.10-x64.msi .... Done
Downloading microsoft.net.workload.emscripten.manifest-6.0.400.msi.x64 (6.0.10)
Installing Microsoft.NET.Workload.Emscripten.Manifest-6.0.400.6.0.10-x64.msi .... Done
Downloading Microsoft.macOS.Sdk.Msi.x64 (12.3.465)
Installing Microsoft.macOS.Sdk.12.3.465.465-x64.msi .... Done
Downloading Microsoft.macOS.Ref.Msi.x64 (12.3.465)
Installing Microsoft.macOS.Ref.12.3.465.465-x64.msi .... Done
Downloading Microsoft.macOS.Runtime.osx-arm64.Msi.x64 (12.3.465)
Installing Microsoft.macOS.Runtime.osx-arm64.12.3.465.465-x64.msi .... Done
Downloading Microsoft.macOS.Runtime.osx-x64.Msi.x64 (12.3.465)
Installing Microsoft.macOS.Runtime.osx-x64.12.3.465.465.msi .... Done
Downloading Microsoft.macOS.Templates.Msi.x64 (12.3.465)
Installing Microsoft.macOS.Templates.12.3.465.465-x64.msi .... Done
Downloading Microsoft.NET.Runtime.MonoAOTCompiler.Task.Msi.x64 (6.0.10)
Installing Microsoft.MonoAOTCompiler.Task.6.0.10-x64.msi .... Done
Downloading Microsoft.NET.Runtime.MonoTargets.Sdk.Msi.x64 (6.0.10)
Installing Microsoft.MonoTargets.Sdk.6.0.10-x64.msi .... Done
Downloading Microsoft.iOS.Sdk.Msi.x64 (16.0.517)
Installing Microsoft.iOS.Sdk.16.0.517.517-x64.msi ..... Done
Downloading Microsoft.iOS.Windows.Sdk.Msi.x64 (16.0.517)
Installing Microsoft.iOS.Windows.Sdk.16.0.517.517-x64.msi ..... Done
Downloading Microsoft.iOS.Ref.Msi.x64 (16.0.517)
Installing Microsoft.iOS.Ref.16.0.517.517-x64.msi .... Done
Downloading Microsoft.iOS.Runtime.ios-arm.Msi.x64 (16.0.517)
Installing Microsoft.iOS.Runtime.ios-arm.16.0.517.517-x64.msi .... Done
Downloading Microsoft.iOS.Runtime.ios-arm64.Msi.x64 (16.0.517)
Installing Microsoft.iOS.Runtime.ios-arm64.16.0.517.517-x64.msi .... Done
Downloading Microsoft.iOS.Runtime.iossimulator-x86.Msi.x64 (16.0.517)
Installing Microsoft.iOS.Runtime.iossimulator-x86.16.0.517.517-x64.msi .... Done
Downloading Microsoft.iOS.Runtime.iossimulator-x64.Msi.x64 (16.0.517)
Installing Microsoft.iOS.Runtime.iossimulator-x64.16.0.517.517.msi .... Done
Downloading Microsoft.iOS.Runtime.iossimulator-arm64.Msi.x64 (16.0.517)
Installing Microsoft.iOS.Runtime.iossimulator-arm64.16.0.517.517-x64.msi .... Done
Downloading Microsoft.iOS.Templates.Msi.x64 (16.0.517)
Installing Microsoft.iOS.Templates.16.0.517.517-x64.msi .... Done
Downloading Microsoft.NETCore.App.Runtime.Mono.ios-arm.Msi.x64 (6.0.10)
Installing Microsoft.Mono.ios-arm.6.0.10-x64.msi ...... Done
Downloading Microsoft.NETCore.App.Runtime.Mono.ios-arm64.Msi.x64 (6.0.10)
Installing Microsoft.Mono.ios-arm64.6.0.10-x64.msi ..... Done
Downloading Microsoft.NETCore.App.Runtime.Mono.iossimulator-arm64.Msi.x64 (6.0.10)
Installing Microsoft.Mono.iossimulator-arm64.6.0.10-x64.msi ..... Done
Downloading Microsoft.NETCore.App.Runtime.Mono.iossimulator-x64.Msi.x64 (6.0.10)
Installing Microsoft.Mono.iossimulator-x64.6.0.10.msi ..... Done
Downloading Microsoft.NETCore.App.Runtime.Mono.iossimulator-x86.Msi.x64 (6.0.10)
Installing Microsoft.Mono.iossimulator-x86.6.0.10-x64.msi ..... Done
Downloading Microsoft.MacCatalyst.Sdk.Msi.x64 (15.4.465)
Installing Microsoft.MacCatalyst.Sdk.15.4.465.465-x64.msi .... Done
Downloading Microsoft.MacCatalyst.Ref.Msi.x64 (15.4.465)
Installing Microsoft.MacCatalyst.Ref.15.4.465.465-x64.msi .... Done
Downloading Microsoft.MacCatalyst.Runtime.maccatalyst-arm64.Msi.x64 (15.4.465)
Installing Microsoft.MacCatalyst.Runtime-arm64.15.4.465.465-x64.msi .... Done
Downloading Microsoft.MacCatalyst.Runtime.maccatalyst-x64.Msi.x64 (15.4.465)
Installing Microsoft.MacCatalyst.Runtime-x64.15.4.465.465.msi .... Done
Downloading Microsoft.MacCatalyst.Templates.Msi.x64 (15.4.465)
Installing Microsoft.MacCatalyst.Templates.15.4.465.465-x64.msi .... Done
Downloading Microsoft.NETCore.App.Runtime.Mono.maccatalyst-arm64.Msi.x64 (6.0.10)
Installing Microsoft.Mono.maccatalyst-arm64.6.0.10-x64.msi ..... Done
Downloading Microsoft.NETCore.App.Runtime.Mono.maccatalyst-x64.Msi.x64 (6.0.10)
Installing Microsoft.Mono.maccatalyst-x64.6.0.10.msi ..... Done

Successfully installed workload(s) macos ios maccatalyst.

PS D:\Code\sentry-dotnet> dotnet workload restore
Installing workloads: android maui-android maui-tizen

Downloading Microsoft.Android.Sdk.Windows.Msi.x64 (32.0.476)
Installing Microsoft.Android.Sdk.Windows.32.0.476-x64.msi ....... Done
Downloading Microsoft.Android.Ref.31.Msi.x64 (32.0.476)
Installing Microsoft.Android.Ref.31.32.0.476-x64.msi .... Done
Downloading Microsoft.Android.Runtime.31.android-arm.Msi.x64 (32.0.476)
Installing Microsoft.Android.Runtime.31.android-arm.32.0.476-x64.msi .... Done
Downloading Microsoft.Android.Runtime.31.android-arm64.Msi.x64 (32.0.476)
Installing Microsoft.Android.Runtime.31.android-arm64.32.0.476-x64.msi .... Done
Downloading Microsoft.Android.Runtime.31.android-x86.Msi.x64 (32.0.476)
Installing Microsoft.Android.Runtime.31.android-x86.32.0.476-x64.msi .... Done
Downloading Microsoft.Android.Runtime.31.android-x64.Msi.x64 (32.0.476)
Installing Microsoft.Android.Runtime.31.android-x64.32.0.476.msi .... Done
Downloading Microsoft.Android.Templates.Msi.x64 (32.0.476)
Installing Microsoft.Android.Templates.32.0.476-x64.msi .... Done
Downloading Microsoft.NETCore.App.Runtime.Mono.android-arm.Msi.x64 (6.0.10)
Installing Microsoft.Mono.android-arm.6.0.10-x64.msi ..... Done
Downloading Microsoft.NETCore.App.Runtime.Mono.android-arm64.Msi.x64 (6.0.10)
Installing Microsoft.Mono.android-arm64.6.0.10-x64.msi ..... Done
Downloading Microsoft.NETCore.App.Runtime.Mono.android-x64.Msi.x64 (6.0.10)
Installing Microsoft.Mono.android-x64.6.0.10.msi ..... Done
Downloading Microsoft.NETCore.App.Runtime.Mono.android-x86.Msi.x64 (6.0.10)
Installing Microsoft.Mono.android-x86.6.0.10-x64.msi ..... Done
Downloading Microsoft.NETCore.App.Runtime.AOT.win-x64.Cross.android-x86.Msi.x64 (6.0.10)
Installing Microsoft.AOT.win-x64.Cross.android-x86.6.0.10.msi ..... Done
Downloading Microsoft.NETCore.App.Runtime.AOT.win-x64.Cross.android-x64.Msi.x64 (6.0.10)
Installing Microsoft.AOT.win-x64.Cross.android-x64.6.0.10.msi .... Done
Downloading Microsoft.NETCore.App.Runtime.AOT.win-x64.Cross.android-arm.Msi.x64 (6.0.10)
Installing Microsoft.AOT.win-x64.Cross.android-arm.6.0.10.msi ..... Done
Downloading Microsoft.NETCore.App.Runtime.AOT.win-x64.Cross.android-arm64.Msi.x64 (6.0.10)
Installing Microsoft.AOT.win-x64.Cross.android-arm64.6.0.10.msi .... Done
Downloading Microsoft.Maui.Core.Ref.android.Msi.x64 (6.0.541)
Installing Maui.Core.Ref.android.6.0.541.0-x64.msi .... Done
Downloading Microsoft.Maui.Core.Runtime.android.Msi.x64 (6.0.541)
Installing Maui.Core.Runtime.android.6.0.541.0-x64.msi .... Done
Downloading Microsoft.Maui.Controls.Ref.android.Msi.x64 (6.0.541)
Installing Maui.Controls.Ref.android.6.0.541.0-x64.msi .... Done
Downloading Microsoft.Maui.Controls.Runtime.android.Msi.x64 (6.0.541)
Installing Maui.Controls.Runtime.android.6.0.541.0-x64.msi .... Done
Downloading Microsoft.Maui.Essentials.Ref.android.Msi.x64 (6.0.541)
Installing Maui.Essentials.Ref.android.6.0.541.0-x64.msi .... Done
Downloading Microsoft.Maui.Essentials.Runtime.android.Msi.x64 (6.0.541)
Installing Maui.Essentials.Runtime.android.6.0.541.0-x64.msi .... Done
Downloading Microsoft.AspNetCore.Components.WebView.Maui.Msi.x64 (6.0.541)
Installing AspNetCore.WebView.Maui.6.0.541.0-x64.msi .... Done
Downloading Microsoft.Maui.Dependencies.Msi.x64 (6.0.541)
Installing Maui.Dependencies.6.0.541.0-x64.msi .... Done
Downloading Microsoft.Maui.Sdk.Msi.x64 (6.0.541)
Installing Maui.Sdk.6.0.541.0-x64.msi .... Done
Downloading Microsoft.Maui.Extensions.Msi.x64 (6.0.541)
Installing Maui.Extensions.6.0.541.0-x64.msi .... Done
Installing Microsoft.Maui.Graphics.6.0.501-x64.msi .... Done
Downloading Microsoft.Maui.Resizetizer.Sdk.Msi.x64 (6.0.541)
Installing Maui.Resizetizer.Sdk.6.0.541.0-x64.msi ..... Done
Downloading Microsoft.Maui.Templates.net6.Msi.x64 (6.0.541)
Installing Maui.Templates.net6.6.0.541.0-x64.msi .... Done
Downloading Microsoft.Maui.Core.Ref.any.Msi.x64 (6.0.541)
Installing Maui.Core.Ref.any.6.0.541.0-x64.msi .... Done
Downloading Microsoft.Maui.Core.Runtime.any.Msi.x64 (6.0.541)
Installing Maui.Core.Runtime.any.6.0.541.0-x64.msi .... Done
Downloading Microsoft.Maui.Controls.Ref.any.Msi.x64 (6.0.541)
Installing Maui.Controls.Ref.any.6.0.541.0-x64.msi .... Done
Downloading Microsoft.Maui.Controls.Runtime.any.Msi.x64 (6.0.541)
Installing Maui.Controls.Runtime.any.6.0.541.0-x64.msi .... Done
Downloading Microsoft.Maui.Essentials.Ref.any.Msi.x64 (6.0.541)
Installing Maui.Essentials.Ref.any.6.0.541.0-x64.msi .... Done
Downloading Microsoft.Maui.Essentials.Runtime.any.Msi.x64 (6.0.541)
Installing Maui.Essentials.Runtime.any.6.0.541.0-x64.msi .... Done
Downloading Microsoft.Maui.Core.Ref.tizen.Msi.x64 (6.0.541)
Installing Maui.Core.Ref.tizen.6.0.541.0-x64.msi .... Done
Downloading Microsoft.Maui.Core.Runtime.tizen.Msi.x64 (6.0.541)
Installing Maui.Core.Runtime.tizen.6.0.541.0-x64.msi .... Done
Downloading Microsoft.Maui.Controls.Ref.tizen.Msi.x64 (6.0.541)
Installing Maui.Controls.Ref.tizen.6.0.541.0-x64.msi .... Done
Downloading Microsoft.Maui.Controls.Runtime.tizen.Msi.x64 (6.0.541)
Installing Maui.Controls.Runtime.tizen.6.0.541.0-x64.msi .... Done
Downloading Microsoft.Maui.Essentials.Ref.tizen.Msi.x64 (6.0.541)
Installing Maui.Essentials.Ref.tizen.6.0.541.0-x64.msi .... Done
Downloading Microsoft.Maui.Essentials.Runtime.tizen.Msi.x64 (6.0.541)
Installing Maui.Essentials.Runtime.tizen.6.0.541.0-x64.msi .... Done

Successfully installed workload(s) android maui-android maui-tizen ios maccatalyst macos.

System Info:

Edition Windows 11 Pro
Version 21H2
Installed on    ‎13/‎10/‎2021
OS build    22000.1098

Microsoft Visual Studio Professional 2022
Version 17.4.0 Preview 2.1
VisualStudio.17.Preview/17.4.0-pre.2.1+32916.344
Microsoft .NET Framework
Version 4.8.04161

Installed Version: Professional

Visual C++ 2022   00476-80000-00000-AA793
Microsoft Visual C++ 2022

ASP.NET and Web Tools   17.4.210.756
ASP.NET and Web Tools

Azure App Service Tools v3.0.0   17.4.210.756
Azure App Service Tools v3.0.0

Azure Functions and Web Jobs Tools   17.4.210.756
Azure Functions and Web Jobs Tools

C# Tools   4.4.0-2.22430.14+2f760738cb92f32f50c981b68ba04ac3c8b7ee48
C# components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

Common Azure Tools   1.10
Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.

Extensibility Message Bus   1.4.1 (main@2ee106a)
Provides common messaging-based MEF services for loosely coupled Visual Studio extension components communication and integration.

Microsoft JVM Debugger   1.0
Provides support for connecting the Visual Studio debugger to JDWP compatible Java Virtual Machines

Mono Debugging for Visual Studio   17.4.19 (8c0a575)
Support for debugging Mono processes with Visual Studio.

NuGet Package Manager   6.4.0
NuGet Package Manager in Visual Studio. For more information about NuGet, visit https://docs.nuget.org/

Razor (ASP.NET Core)   17.0.0.2243101+64a0117763b8eb085c75bdb80329e16e5a2c65a5
Provides languages services for ASP.NET Core Razor.

SQL Server Data Tools   17.0.62207.28050
Microsoft SQL Server Data Tools

Syntax Visualizer   1.0
An extension for visualizing Roslyn SyntaxTrees.

TypeScript Tools   17.0.10901.2002
TypeScript Tools for Microsoft Visual Studio

Visual Basic Tools   4.4.0-2.22430.14+2f760738cb92f32f50c981b68ba04ac3c8b7ee48
Visual Basic components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

Visual F# Tools   17.4.0-beta.22429.6+22514929f2e903ea8c14947bea7c2b242886e1ee
Microsoft Visual F# Tools

Visual Studio Tools for Unity   17.4.2.0
Visual Studio Tools for Unity

VisualStudio.DeviceLog   1.0
Information about my package

VisualStudio.Mac   1.0
Mac Extension for Visual Studio

Xamarin   17.4.0.171 (d17-4-net7@4d0f4c0)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin Designer   17.4.0.124 (remotes/origin/d17-4@ffbba0c031)
Visual Studio extension to enable Xamarin Designer tools in Visual Studio.

Xamarin Templates   17.4.2 (c457c97)
Templates for building iOS, Android, and Windows apps with Xamarin and Xamarin.Forms.

Xamarin.Android SDK   13.0.99.81 (main/7c9c24b)
Xamarin.Android Reference Assemblies and MSBuild support.
    Mono: dffa5ab
    Java.Interop: xamarin/java.interop/main@2c8b0a8f
    SQLite: xamarin/sqlite/3.39.2@40e8743
    Xamarin.Android Tools: xamarin/xamarin-android-tools/main@29f11f2

Xamarin.iOS and Xamarin.Mac SDK   15.13.0.65 (409c80dd9)
Xamarin.iOS and Xamarin.Mac Reference Assemblies and MSBuild support.

output from dotnet workload list

Installed Workload Ids      Manifest Version      Installation Source
---------------------------------------------------------------------
android                     32.0.476/6.0.400      SDK 6.0.400
ios                         16.0.517/6.0.400      SDK 6.0.400
maccatalyst                 15.4.465/6.0.400      SDK 6.0.400
macos                       12.3.465/6.0.400      SDK 6.0.400
maui-android                6.0.541/6.0.400       SDK 6.0.400
maui-tizen                  6.0.541/6.0.400       SDK 6.0.400

@mattjohnsonpint might have some more insight to add

mattjohnsonpint commented 2 years ago

All I can offer to add is that for me, dotnet workload restore almost never works on large complex multitargeted solutions. Instead I use dotnet workload install with a specific workload I know the solution needs (usually maui since it picks up all the others as dependencies). Once installed I also use dotnet workload update to keep updated. But I never use dotnet workload restore. Its scan for what workloads are required is just too buggy.

Also I've learned two other things are important:

marcpopMSFT commented 2 years ago

@jonathanpeppers @Redth is it possible the macos ios or macacalyst workload install brings down some targets that then requires additional workloads? Is there a missing workload dependency on the maui side?

Alternatively, this could be a multi-targeting issue in the restore logic where it's not catching all on the first pass.

dsplaisted commented 2 years ago

@SimonCropp Would it be possible to get a binlog from before the first workload restore, and also after the first one but before the second one?

SimonCropp commented 2 years ago

unfortunately i am no longer working on this project