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.66k stars 1.06k forks source link

Can't create/build Blazor (Wasm) without problems of missing Workloads? #30067

Open deepx opened 1 year ago

deepx commented 1 year ago

Bug for create a Blazor Wasm Project with Template from VS2022 CE

When i start VS2022 Community after a fresh installation and only create a blank Blazor-Wasm Project and try to run it without any changes the outputwindow shows the following:

Build started... 1>------ Build started: Project: Blazor7WasmTest.Shared, Configuration: Debug Any CPU ------ 1>Skipping analyzers to speed up the build. You can execute 'Build' or 'Rebuild' command to run analyzers. 1>Blazor7WasmTest.Shared -> C:\Users\djdee\source\repos\Blazor7WasmTest\Blazor7WasmTest\Shared\bin\Debug\net7.0\Blazor7WasmTest.Shared.dll 2>------ Build started: Project: Blazor7WasmTest.Client, Configuration: Debug Any CPU ------ 2>C:\Program Files\dotnet\sdk\7.0.102\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.ImportWorkloads.targets(38,5): error NETSDK1178: The project depends on the following workload packs that do not exist in any of the workloads available in this installation: Microsoft.NET.Runtime.Emscripten.Python Microsoft.NET.Runtime.Emscripten.Node Microsoft.NET.Runtime.Emscripten.Sdk 2>C:\Program Files\dotnet\sdk\7.0.102\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.ImportWorkloads.targets(38,5): error NETSDK1178: You may need to build the project on another operating system or architecture, or update the .NET SDK. 2>Done building project "Blazor7WasmTest.Client.csproj" -- FAILED. 3>------ Build started: Project: Blazor7WasmTest.Server, Configuration: Debug Any CPU ------ 3>C:\Program Files\dotnet\sdk\7.0.102\Sdks\Microsoft.NET.Sdk.Razor\targets\Microsoft.NET.Sdk.Razor.MvcApplicationPartsDiscovery.targets(54,5): warning RAZORSDK1007: Reference assembly C:\Users\djdee\source\repos\Blazor7WasmTest\Blazor7WasmTest\Client\bin\Debug\net7.0\Blazor7WasmTest.Client.dll could not be found. This is typically caused by build errors in referenced projects. 3>Skipping analyzers to speed up the build. You can execute 'Build' or 'Rebuild' command to run analyzers. 3>CSC : error CS0006: Metadata file 'C:\Users\djdee\source\repos\Blazor7WasmTest\Blazor7WasmTest\Client\obj\Debug\net7.0\ref\Blazor7WasmTest.Client.dll' could not be found 3>Done building project "Blazor7WasmTest.Server.csproj" -- FAILED. ========== Build: 1 succeeded, 2 failed, 0 up-to-date, 0 skipped ========== ========== Elapsed 00:00,679 ==========

The errors i get when i try to build the same blank template in terminal (even with dotnet new blazorwasm)

~#@❯ dotnet build MSBuild version 17.4.1+9a89d02ff for .NET Wiederherzustellende Projekte werden ermittelt... C:\Program Files\dotnet\sdk\7.0.102\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.ImportWorkloads.targets(38,5): err or NETSDK1178: Das Projekt hängt von den folgenden Workloadpaketen ab, die in keiner der in dieser Installation verfügb aren Workloads vorhanden sind: Microsoft.NET.Runtime.Emscripten.Python Microsoft.NET.Runtime.Emscripten.Node Microsoft. NET.Runtime.Emscripten.Sdk [C:\Users\djdee\source\repos\Blazor7WasmTest\Blazor7WasmTest\Client\Blazor7WasmTest.Client.c sproj] C:\Program Files\dotnet\sdk\7.0.102\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.ImportWorkloads.targets(38,5): err or NETSDK1178: Sie müssen das Projekt möglicherweise unter einem anderen Betriebssystem oder einer anderen Architektur erstellen, oder das .NET-SDK aktualisieren. [C:\Users\djdee\source\repos\Blazor7WasmTest\Blazor7WasmTest\Client\Blazor7 WasmTest.Client.csproj]

Fehler beim Buildvorgang.

C:\Program Files\dotnet\sdk\7.0.102\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.ImportWorkloads.targets(38,5): err or NETSDK1178: Das Projekt hängt von den folgenden Workloadpaketen ab, die in keiner der in dieser Installation verfügb aren Workloads vorhanden sind: Microsoft.NET.Runtime.Emscripten.Python Microsoft.NET.Runtime.Emscripten.Node Microsoft. NET.Runtime.Emscripten.Sdk [C:\Users\djdee\source\repos\Blazor7WasmTest\Blazor7WasmTest\Client\Blazor7WasmTest.Client.c sproj] C:\Program Files\dotnet\sdk\7.0.102\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.ImportWorkloads.targets(38,5): err or NETSDK1178: Sie müssen das Projekt möglicherweise unter einem anderen Betriebssystem oder einer anderen Architektur erstellen, oder das .NET-SDK aktualisieren. [C:\Users\djdee\source\repos\Blazor7WasmTest\Blazor7WasmTest\Client\Blazor7 WasmTest.Client.csproj] 0 Warnung(en) 1 Fehler

Error from dotnet workload repair

~\source\repos\Blazor7WasmTest ~#@❯ dotnet workload repair

Die Workload-Installation für Workloads wird repariert: ios maui maui-desktop maui-ios maui-mobile maui-windows runtimes-windows runtimes-windows-net6 wasm-experimental wasm-tools wasm-tools-net6 Für den Computer steht ein Neustart aus. Die Installation wird fortgesetzt, aber Sie müssen möglicherweise neu starten. Microsoft.iOS.Sdk.16.1.21.0-x64.msi wird repariert .... Failed Fehler bei der Reparatur von Workload: Failed to repair Microsoft.iOS.Sdk.16.1.21.0-x64.msi. Error: 0x0000064c. Die Installationsquelle für dieses Produkt ist nicht verfügbar. Stellen Sie sicher, dass die Quelle vorhanden ist und Sie Zugriff darauf haben.

Information from dotnet --info

~#@❯ dotnet --info .NET SDK: Version: 7.0.102 Commit: 4bbdd14480

Laufzeitumgebung: OS Name: Windows OS Version: 10.0.22621 OS Platform: Windows RID: win10-x64 Base Path: C:\Program Files\dotnet\sdk\7.0.102\

Host: Version: 7.0.2 Architecture: x64 Commit: d037e070eb

.NET SDKs installed: 3.1.426 [C:\Program Files\dotnet\sdk] 5.0.302 [C:\Program Files\dotnet\sdk] 5.0.403 [C:\Program Files\dotnet\sdk] 5.0.406 [C:\Program Files\dotnet\sdk] 5.0.408 [C:\Program Files\dotnet\sdk] 5.0.416 [C:\Program Files\dotnet\sdk] 6.0.113 [C:\Program Files\dotnet\sdk] 6.0.203 [C:\Program Files\dotnet\sdk] 6.0.308 [C:\Program Files\dotnet\sdk] 6.0.405 [C:\Program Files\dotnet\sdk] 7.0.102 [C:\Program Files\dotnet\sdk]

.NET runtimes installed: Microsoft.AspNetCore.All 2.1.30 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All] Microsoft.AspNetCore.App 2.1.30 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 3.1.21 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 3.1.32 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 5.0.12 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 5.0.15 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 5.0.17 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 6.0.2 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 6.0.5 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 6.0.13 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 7.0.2 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.NETCore.App 2.1.30 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 3.1.21 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 3.1.32 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 5.0.12 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 5.0.15 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 5.0.17 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 6.0.1 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 6.0.2 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 6.0.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 6.0.13 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 7.0.2 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.WindowsDesktop.App 3.1.21 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 3.1.32 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 5.0.12 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 5.0.15 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 5.0.17 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 6.0.2 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 6.0.5 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 6.0.13 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 7.0.2 [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

Output of dotnet workload list

~#@❯ dotnet workload list

Installierte Workload-ID Manifestversion Installationsquelle

ios 16.1.1481/7.0.100 SDK 7.0.100, VS 17.4.33213.308 maui 7.0.58/7.0.100 SDK 7.0.100 maui-desktop 7.0.58/7.0.100 SDK 7.0.100 maui-ios 7.0.58/7.0.100 SDK 7.0.100, VS 17.4.33213.308 maui-mobile 7.0.58/7.0.100 SDK 7.0.100 maui-windows 7.0.58/7.0.100 SDK 7.0.100, VS 17.4.33213.308 runtimes-windows 7.0.2/7.0.100 SDK 7.0.100 runtimes-windows-net6 7.0.2/7.0.100 SDK 7.0.100 wasm-experimental 7.0.2/7.0.100 SDK 7.0.100 wasm-tools 7.0.2/7.0.100 SDK 7.0.100, VS 17.4.33213.308 wasm-tools-net6 7.0.2/7.0.100 SDK 7.0.100, VS 17.4.33213.308 maui-maccatalyst 7.0.58/7.0.100 VS 17.4.33213.308 maccatalyst 16.1.1481/7.0.100 VS 17.4.33213.308 maui-android 7.0.58/7.0.100 VS 17.4.33213.308 android 33.0.26/7.0.100 VS 17.4.33213.308

IDE Information

Microsoft Visual Studio Community 2022 Version 17.4.4 VisualStudio.17.Release/17.4.4+33213.308 Microsoft .NET Framework Version 4.8.09032

Installed Version: Community

Visual C++ 2022 00482-90000-00000-AA805 Microsoft Visual C++ 2022

ADL Tools Service Provider 1.0 This package contains services used by Data Lake tools

ASA Service Provider 1.0

ASP.NET and Web Tools 17.4.326.54890 ASP.NET and Web Tools

Azure App Service Tools v3.0.0 17.4.326.54890 Azure App Service Tools v3.0.0

Azure Data Lake Tools for Visual Studio 2.6.5000.0 Microsoft Azure Data Lake Tools for Visual Studio

Azure Functions and Web Jobs Tools 17.4.326.54890 Azure Functions and Web Jobs Tools

Azure Stream Analytics Tools for Visual Studio 2.6.5000.0 Microsoft Azure Stream Analytics Tools for Visual Studio

C# Tools 4.4.0-6.22608.27+af1e46ad38d900023f8b1a2839484e471ece1502 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.

Cookiecutter 17.0.22263.6 Provides tools for finding, instantiating and customizing templates in cookiecutter format.

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

Linux Core Dump Debugging 1.0.9.33020 Enables debugging of Linux core dumps.

Microsoft Azure Hive Query Language Service 2.6.5000.0 Language service for Hive query

Microsoft Azure Stream Analytics Language Service 2.6.5000.0 Language service for Azure Stream Analytics

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.

Node.js Tools 1.5.40817.1 Commit Hash:66443775f9f3b1d8f8fee47af5002828b346688d Adds support for developing and debugging Node.js apps in Visual Studio

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

Python - Django support 17.0.22263.6 Provides templates and integration for the Django web framework.

Python - Profiling support 17.0.22263.6 Profiling support for Python projects.

Python with Pylance 17.0.22263.6 Provides IntelliSense, projects, templates, debugging, interactive windows, and other support for Python developers.

Razor (ASP.NET Core) 17.0.0.2246202+61cc048d36a3fc9246d2f04625988b19a18ab8f0 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.

Test Adapter for Boost.Test 1.0 Enables Visual Studio's testing tools with unit tests written for Boost.Test. The use terms and Third Party Notices are available in the extension installation directory.

Test Adapter for Google Test 1.0 Enables Visual Studio's testing tools with unit tests written for Google Test. The use terms and Third Party Notices are available in the extension installation directory.

ToolWindowHostedEditor 1.0 Hosting json editor into a tool window

TypeScript Tools 17.0.10921.2001 TypeScript Tools for Microsoft Visual Studio

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

Visual C++ for Cross Platform Mobile Development (Android) 17.0.33006.217 Visual C++ for Cross Platform Mobile Development (Android)

Visual C++ for Linux Development 1.0.9.33020 Visual C++ for Linux Development

Visual F# Tools 17.4.0-beta.22512.4+525d5109e389341bb90b144c24e2ad1ceec91e7b Microsoft Visual F# Tools

Visual Studio IntelliCode 2.2 AI-assisted development for Visual Studio.

VisualStudio.DeviceLog 1.0 Information about my package

VisualStudio.Mac 1.0 Mac Extension for Visual Studio

VSPackage Extension 1.0 VSPackage Visual Studio Extension Detailed Info

Xamarin 17.4.0.312 (d17-4@be7e8d1) Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin Designer 17.4.0.138 (remotes/origin/d17-4@d36bba3cc9) 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.1.0.1 (d17-4/13ba222) Xamarin.Android Reference Assemblies and MSBuild support. Mono: a96bde9 Java.Interop: xamarin/java.interop/d17-4@fcc33ce2 SQLite: xamarin/sqlite/3.39.3@23e1ae7 Xamarin.Android Tools: xamarin/xamarin-android-tools/main@0be567a

Xamarin.iOS and Xamarin.Mac SDK 16.1.1.27 (933c6c2c9) Xamarin.iOS and Xamarin.Mac Reference Assemblies and MSBuild support.

dotnet-issue-labeler[bot] commented 1 year ago

I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.

deepx commented 1 year ago

Forget to Mention when creating BlazorWasm new from commandline:

~#@❯ dotnet new blazorwasm -o Blazor7Test ❮  1 Die Vorlage "Blazor-WebAssembly App" wurde erfolgreich erstellt. Diese Vorlage enthält Technologien von anderen Anbietern als Microsoft, siehe https://aka.ms/aspnetcore/7.0-third-party-notices für Details.

Aktionen nach der Erstellung werden verarbeitet... Wiederherstellung C:\Users\djdee\source\repos\Blazor7Test\Blazor7Test.csproj: Wiederherzustellende Projekte werden ermittelt... C:\Program Files\dotnet\sdk\7.0.102\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.ImportWorkloads.targets(38,5): err or NETSDK1178: Das Projekt hängt von den folgenden Workloadpaketen ab, die in keiner der in dieser Installation verfügb aren Workloads vorhanden sind: Microsoft.NET.Runtime.Emscripten.Python Microsoft.NET.Runtime.Emscripten.Node Microsoft. NET.Runtime.Emscripten.Sdk [C:\Users\djdee\source\repos\Blazor7Test\Blazor7Test.csproj] C:\Program Files\dotnet\sdk\7.0.102\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.ImportWorkloads.targets(38,5): err or NETSDK1178: Sie müssen das Projekt möglicherweise unter einem anderen Betriebssystem oder einer anderen Architektur erstellen, oder das .NET-SDK aktualisieren. [C:\Users\djdee\source\repos\Blazor7Test\Blazor7Test.csproj] Fehler beim Wiederherstellen. Fehler beim Posten der Aktion. Manuelle Anweisungen: Führen Sie 'dotnet restore' aus

~#@❯ cd .\Blazor7Test\ ~#@❯ dotnet restore Wiederherzustellende Projekte werden ermittelt... C:\Program Files\dotnet\sdk\7.0.102\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.ImportWorkloads.targets(38,5): err or NETSDK1178: Das Projekt hängt von den folgenden Workloadpaketen ab, die in keiner der in dieser Installation verfügb aren Workloads vorhanden sind: Microsoft.NET.Runtime.Emscripten.Python Microsoft.NET.Runtime.Emscripten.Node Microsoft. NET.Runtime.Emscripten.Sdk [C:\Users\djdee\source\repos\Blazor7Test\Blazor7Test.csproj] C:\Program Files\dotnet\sdk\7.0.102\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.ImportWorkloads.targets(38,5): err or NETSDK1178: Sie müssen das Projekt möglicherweise unter einem anderen Betriebssystem oder einer anderen Architektur erstellen, oder das .NET-SDK aktualisieren. [C:\Users\djdee\source\repos\Blazor7Test\Blazor7Test.csproj]

danroth27 commented 1 year ago

@lewing Any ideas on this one?