32

I am using Visual Studio 2022 for Blazor WebAssembly Project and the ASP.NET Core API Project. When I run these projects independently, they works fine in Edge, Chrome browsers but, when I select Multiple-Startup projects, I am getting the following error.


Microsoft Visual Studio

One or more errors occurred.

Failed to launch debug adapter. Additional information may be available in the output window.

The operation was canceled.

OK

enter image description here

DevThiman
  • 920
  • 1
  • 9
  • 24
Mahesh S
  • 451
  • 1
  • 5
  • 7
  • Which version of VS2022? What is the relation between Wasm and API projects? Are they from the Hosted template or did you set up 2 indep projects? – H H Dec 16 '21 at 15:53
  • On what URLs (port numbers) and in which order are they started? – H H Dec 16 '21 at 15:55
  • The API Project is started first and then the WASM Application. The WASM application is calling the API for Authentication. This is really irritating. – Mahesh S Jan 07 '22 at 10:56
  • 1
    Rebooting my computer solved this for me. – Eric J. Aug 29 '22 at 13:54

11 Answers11

34

I had the same issue with Visual Studio 2022. I could solve the issue by disabling the script debugging in the drop-down of green arrow where we run the project. Please see the following screenshot.

enter image description here

Chamila Maddumage
  • 3,304
  • 2
  • 32
  • 43
10

One working tweek is disabling JavaScript debugging in either of these two ways:

1. Disabling Script Debugging from IIS

enter image description here

2. Removing the 'Enable' tick from JavaScript Debugging option

enter image description here

Ali Safari
  • 1,535
  • 10
  • 19
9

I had this issue until I removed this line from launchsettings.json under profiles on the server side code.

Failed to launch debug adapter Unable to launch browser...

"inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}",
T.S.
  • 18,195
  • 11
  • 58
  • 78
user19795966
  • 91
  • 1
  • 1
  • 1
    I voted for this because it did work, but unfortunately removing that line prevents breakpoints from binding in Razor views (possibly elsewhere but that's the problem I ended up with). I suppose I should have expected trouble disabling something that's part of a "debug adapter" :-) I've stopped trying to debug framework sources now (which was what caused the initial problem), and re-added the line and everything's working. Except framework source debugging... – Jon Aug 19 '22 at 15:07
4

Finally..... I resolved by modifying Tools-->Options-->Debugging--->General and enabling following two checkboxes as shown in imageenter image description here

Mahesh S
  • 451
  • 1
  • 5
  • 7
1

Try to stop the site in the IISExpress background process in the system tray of the target project. Then exit the IISExpress background process itself.

enter image description here

Refer to this article:

https://techstrology.com/failed-to-launch-debug-adapter-the-program-has-exited-with-code-1-0xffffffff-visual-studio-failed-and-crashed/

Tupac
  • 2,590
  • 2
  • 6
  • 19
1

I solved this problem by setting the config "launchBrowser": false for the current profile in the file Properties/launchSettings.json.

It seems there is a browser launch problem. This may be caused by rights issues.

Watki02
  • 4,696
  • 7
  • 34
  • 36
maloun
  • 39
  • 4
0

On a related note, I encountered this error message after cloning the first Blazor project I'd worked on in VS 2022.

It turned out that I hadn't installed all the build tools required for the (WebAssembly) Blazor project.

Go to Tools \ Get Tools and Features... then the Individual Components tab.

After adding .NET 6.0 WebAssembly Build Tools and .NET WebAssembly Build Tools I was able to successfully debug the project.

Ted
  • 2,525
  • 2
  • 37
  • 54
0

I run into this issue because of powershell restrict mode.

Cannot dot-source this command because it was defined in a different language mode. To invoke this command without importing its contents, omit the '.' operator.

I solve it by the following steps.

  • Download the VsDbg downloaded from https://aka.ms/getvsdbgps1
  • Open the powershell terminal and navigate to the location where the downloaded file is located.
  • Execute - .\GetVsDbg.ps1 -Version vs2017u5 -RuntimeID linux-x64 -InstallPath "C:\Users[YOUR_USER_NAME]\vsdbg\vs2017u5"
  • Execute - .\GetVsDbg.ps1 -Version vs2017u5 -RuntimeID linux-musl-x64 -InstallPath "C:\Users[YOUR_USER_NAME]\vsdbg\vs2017u5\linux-musl-x64"
袁呈呈
  • 1
  • 1
  • C:\Users\xxx\AppData\Local\Temp\GetVsDbg.ps1 : Cannot dot-source this command because it was defined in a different language mode. To invoke this command without importing its contents, omit the '.' operator. + CategoryInfo : InvalidOperation: (:) [GetVsDbg.ps1], NotSupportedException + FullyQualifiedErrorId : DotSourceNotSupported,GetVsDbg.ps1 – 袁呈呈 Feb 15 '23 at 09:34
0

deleting the VSDBG debugger folder located at "%USERPROFILE%\vsdbg\vs2017u5" may help resolve the issue. Once you have deleted this folder, you can restart the debugger by pressing F5. Doing so will trigger the automatic recreation of the VSDBG debugger.

For further information on debug properties, you may want to consult Microsoft's official documentation, which can be found at https://learn.microsoft.com/en-us/visualstudio/containers/container-msbuild-properties?view=vs-2022. This documentation covers the use of various properties in MSBuild files to control the behavior of the debugger in containerized environments.

ahaliav fox
  • 2,217
  • 22
  • 21
0

For me, just closing the browser solved it.

SamBerk
  • 311
  • 2
  • 10
-1

I was able to resolve this issue by selecting a newer version of python in the debug properties. To do that, go to Debug>ProjectName Debug Properties>General. In that window select a newer python version next to Interpreter. In my case, Python 3.9 worked.

If no other python versions are displayed, you will have to install a newer version of python. I was making a console application and this is the only thing that worked.

Aj_
  • 494
  • 4
  • 13