Despite configuring a preLaunchTask to build (using dotnet build) on a Blazor WebAssembly Hosted app in the .vscode\launch.json and .vscode\tasks.json files, the task is not run. The task is run when the C# extension is disabled (however, this leads to the launch failing, as the ms-dotnettools.blazorwasm-companion also becomes disabled, leading to the error message "Configured debug type 'blazorwasm' is not supported.").
I searched for a similar issue, but I could not find one. My apologies in advance if there is such an issue and a solution. If that is the case, kindly provide the link.
Steps to Reproduce
Create a new Blazor WebAssembly Hosted app by running 'dotnet new blazorwasm --hosted').
Use the following configuration files in the .vscode folder:
I am seeing the same behavior. I'm using a dev container. Even if I change the preLaunchTask to an invalid option, VS Code doesn't notice or care. It just proceeds with the launch.
Issue Description
Despite configuring a preLaunchTask to build (using
dotnet build
) on a Blazor WebAssembly Hosted app in the .vscode\launch.json and .vscode\tasks.json files, the task is not run. The task is run when the C# extension is disabled (however, this leads to the launch failing, as thems-dotnettools.blazorwasm-companion
also becomes disabled, leading to the error message "Configured debug type 'blazorwasm' is not supported.").I searched for a similar issue, but I could not find one. My apologies in advance if there is such an issue and a solution. If that is the case, kindly provide the link.
Steps to Reproduce
launch.json:
tasks.json:
Expected Behavior
The
dotnet build
command should be executed before launching the apps. The build would result in an error and the apps would not be launched.Actual Behavior
The apps launch immediately.
Environment information
VSCode version: 1.83.0 C# Extension: 2.5.30 Using OmniSharp: false
Dotnet Information
.NET SDK: Version: 7.0.401 Commit: eb26aacfec Runtime Environment: OS Name: Windows OS Version: 10.0.19045 OS Platform: Windows RID: win10-x64 Base Path: C:\Program Files\dotnet\sdk\7.0.401\ Host: Version: 7.0.11 Architecture: x64 Commit: ecb34f85ec .NET SDKs installed: 7.0.401 [C:\Program Files\dotnet\sdk] .NET runtimes installed: Microsoft.AspNetCore.App 6.0.22 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 7.0.11 [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 5.0.17 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 6.0.11 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 6.0.20 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 6.0.22 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 7.0.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 7.0.9 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 7.0.11 [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 5.0.17 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 6.0.11 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 6.0.20 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 6.0.22 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 7.0.0 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 7.0.9 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 7.0.11 [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/downloadVisual Studio Code Extensions
|Extension|Author|Version|Folder Name| |---|---|---|---| |blazorwasm-companion|ms-dotnettools|1.1.4|ms-dotnettools.blazorwasm-companion-1.1.4| |csharp|ms-dotnettools|2.5.30|ms-dotnettools.csharp-2.5.30-win32-x64| |gitlens|eamodio|14.3.0|eamodio.gitlens-14.3.0| |LiveServer|ritwickdey|5.7.9|ritwickdey.liveserver-5.7.9| |remote-containers|ms-vscode-remote|0.315.1|ms-vscode-remote.remote-containers-0.315.1| |sonarlint-vscode|SonarSource|3.22.0|sonarsource.sonarlint-vscode-3.22.0-win32-x64| |vscode-docker|ms-azuretools|1.26.1|ms-azuretools.vscode-docker-1.26.1| |vscode-dotnet-runtime|ms-dotnettools|1.8.0|ms-dotnettools.vscode-dotnet-runtime-1.8.0| |vscode-yaml|redhat|1.14.0|redhat.vscode-yaml-1.14.0|;