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

Templates from Workload Disappear after VS Update #42710

Open SerratedSharp opened 1 month ago

SerratedSharp commented 1 month ago

Is it expected that the templates from the wasm workloads disappear every time I update VS2022? Should workloads become integrated with the VS2022 Installer so it can track your previous selections between updates?

This has happened at least twice now, that after updating VS, I noticed templates are gone, and pre-existing projects using the wasm-browser template have problems. IDK if this is because I'm on a preview channel. (Update Settings won't let me off the Preview channel)

When I update VS without remembering to reinstall the workload, then my wasm-browser projects no longer automatically launch the browser when starting a debug session, and the self-host uses a random port instead of the one configured. Enough time passes that I forget what causes this issue, and am frustrated a bit trying to remember why it's having problems. It seems like the project should have something to alert you if it's missing.

Once I reinstall the dotnet wasm-experimental workload, then close and reopen VS, then the project behaves correctly, and additionally I can again see the templates in the New Project dialog.

Here's output from reinstalling after my most recent update to 17.11.0 Preview 4:

PM> dotnet workload install wasm-experimental

Welcome to .NET 8.0!
---------------------
SDK Version: 8.0.400-preview.0.24324.5

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'
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
--------------------------------------------------------------------------------------

Writing install records for Visual Studio workloads: 'aspire'
Downloading microsoft.net.sdk.ios.manifest-8.0.100.msi.x64 (17.2.8078)
Installing microsoft.net.sdk.ios.manifest-8.0.100.msi.x64 .... Done
Downloading microsoft.net.sdk.maccatalyst.manifest-8.0.100.msi.x64 (17.2.8078)
Installing microsoft.net.sdk.maccatalyst.manifest-8.0.100.msi.x64 .... Done
Downloading microsoft.net.sdk.macos.manifest-8.0.100.msi.x64 (14.2.8078)
Installing microsoft.net.sdk.macos.manifest-8.0.100.msi.x64 .... Done
Downloading microsoft.net.sdk.tvos.manifest-8.0.100.msi.x64 (17.2.8078)
Installing microsoft.net.sdk.tvos.manifest-8.0.100.msi.x64 .... Done
Downloading microsoft.net.sdk.aspire.manifest-8.0.100.msi.x64 (8.1.0)
Installing microsoft.net.sdk.aspire.manifest-8.0.100.msi.x64 .... Done
Downloading Microsoft.NET.Runtime.WebAssembly.Templates.Msi.x64 (8.0.7)
Installing Microsoft.NET.Runtime.WebAssembly.Templates.Msi.x64 .... Done
Downloading Microsoft.NETCore.App.Runtime.Mono.multithread.browser-wasm.Msi.x64 (8.0.7)
Installing Microsoft.NETCore.App.Runtime.Mono.multithread.browser-wasm.Msi.x64 ...... Done
Downloading Microsoft.NET.Runtime.WebAssembly.Sdk.Msi.x64 (8.0.7)
Installing Microsoft.NET.Runtime.WebAssembly.Sdk.Msi.x64 .... Done
Downloading Microsoft.NETCore.App.Runtime.Mono.browser-wasm.Msi.x64 (8.0.7)
Installing Microsoft.NETCore.App.Runtime.Mono.browser-wasm.Msi.x64 ...... Done
Downloading Microsoft.NETCore.App.Runtime.AOT.win-x64.Cross.browser-wasm.Msi.x64 (8.0.7)
Installing Microsoft.NETCore.App.Runtime.AOT.win-x64.Cross.browser-wasm.Msi.x64 .... Done
Downloading Microsoft.NET.Runtime.MonoAOTCompiler.Task.Msi.x64 (8.0.7)
Installing Microsoft.NET.Runtime.MonoAOTCompiler.Task.Msi.x64 .... Done
Downloading Microsoft.NET.Runtime.MonoTargets.Sdk.Msi.x64 (8.0.7)
Installing Microsoft.NET.Runtime.MonoTargets.Sdk.Msi.x64 .... Done
Downloading Microsoft.NET.Runtime.Emscripten.3.1.34.Node.win-x64.Msi.x64 (8.0.7)
Installing Microsoft.NET.Runtime.Emscripten.3.1.34.Node.win-x64.Msi.x64 .... Done
Downloading Microsoft.NET.Runtime.Emscripten.3.1.34.Python.win-x64.Msi.x64 (8.0.7)
Installing Microsoft.NET.Runtime.Emscripten.3.1.34.Python.win-x64.Msi.x64 ........ Done
Downloading Microsoft.NET.Runtime.Emscripten.3.1.34.Cache.win-x64.Msi.x64 (8.0.7)
Installing Microsoft.NET.Runtime.Emscripten.3.1.34.Cache.win-x64.Msi.x64 ........... Done
Downloading Microsoft.NET.Runtime.Emscripten.3.1.34.Sdk.win-x64.Msi.x64 (8.0.7)
Installing Microsoft.NET.Runtime.Emscripten.3.1.34.Sdk.win-x64.Msi.x64 ........................... Done
Downloading Aspire.Hosting.Sdk.Msi.x64 (8.1.0)
Installing Aspire.Hosting.Sdk.Msi.x64 .... Done
Downloading Aspire.ProjectTemplates.Msi.x64 (8.1.0)
Installing Aspire.ProjectTemplates.Msi.x64 .... Done
Downloading Aspire.Hosting.Orchestration.win-x64.Msi.x64 (8.1.0)
Installing Aspire.Hosting.Orchestration.win-x64.Msi.x64 ..... Done
Downloading Aspire.Hosting.Msi.x64 (8.1.0)
Installing Aspire.Hosting.Msi.x64 .... Done
Downloading Aspire.Dashboard.Sdk.win-x64.Msi.x64 (8.1.0)
Installing Aspire.Dashboard.Sdk.win-x64.Msi.x64 ..... Done
Removing Microsoft.NET.Sdk.Aspire.Manifest-8.0.100.Msi.x64 .... Done
Removing Aspire.Dashboard.Sdk.win-x64.Msi.x64 ..... Done
Removing Aspire.Hosting.Msi.x64 .... Done
Removing Aspire.Hosting.Orchestration.win-x64.Msi.x64 .... Done
Removing Aspire.Hosting.Sdk.Msi.x64 .... Done
Removing Aspire.ProjectTemplates.Msi.x64 .... Done
Removing Microsoft.NET.Runtime.Emscripten.3.1.34.Cache.win-x64.Msi.x64 ............ Done
Removing Microsoft.NET.Runtime.Emscripten.3.1.34.Node.win-x64.Msi.x64 .... Done
Removing Microsoft.NET.Runtime.Emscripten.3.1.34.Python.win-x64.Msi.x64 ......... Done
Removing Microsoft.NET.Runtime.Emscripten.3.1.34.Sdk.win-x64.Msi.x64 ............................. Done
Removing Microsoft.NET.Runtime.MonoAOTCompiler.Task.Msi.x64 .... Done
Removing Microsoft.NET.Runtime.MonoTargets.Sdk.Msi.x64 .... Done
Removing Microsoft.NET.Runtime.WebAssembly.Sdk.Msi.x64 .... Done
Removing Microsoft.NET.Runtime.WebAssembly.Templates.Msi.x64 .... Done
Removing Microsoft.NETCore.App.Runtime.AOT.win-x64.Cross.browser-wasm.Msi.x64 .... Done
Removing Microsoft.NETCore.App.Runtime.Mono.browser-wasm.Msi.x64 ...... Done
Removing Microsoft.NETCore.App.Runtime.Mono.multithread.browser-wasm.Msi.x64 ..... Done

Successfully installed workload(s) wasm-experimental aspire.

If it were already installed, it would have shown this output:

PM> dotnet workload install wasm-experimental

Workload(s) 'wasm-experimental' are already installed.
SerratedSharp commented 1 month ago

Note: I didn't have this problem when I went from 17.11.0 Preview 4 to 17.11.0 final release. I didn't have to reinstall workloads in that case.

I'd just be curious if this is by design to require reinstall each time, and if so I think that's a pretty bad experience compared to what we're conditioned to expect when compared to other tooling such as components selected in Visual Studio Installer or Extensions. Having to go and re-lookup documentation every time I upgrade VS to figure out what workloads I need for the given things I'm, trying to do(some of them aren't named super intuitively) to reinstall is not good, nor is the way the project breaks without clear errors.

Otherwise if I encountered a fluke, maybe because I was using preview versions, then I'd be in favor of closing this out. I don't have any way to try and reproduce reliably without uninstalling and then trying to step through versions, and I'm not in a position to subject my dev machine to that.