Azure / Azure/static-web-apps-cli

SWA CLI and Visual Studio debugger does not connect in Visual Studio 17.8.6

Offen
#801 2 Kommentare 3 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
TypeScript
Sterne
668
Forks
156
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

Before filing this issue, please ensure you're using the latest CLI by running `swa --version` and comparing to the latest version on [npm](https://www.npmjs.com/package/@azure/static-web-apps-cli).

**Are you accessing the CLI from the default port `:4280` ?**

- [x] Yes, I am accessing the CLI from port `:4280`

> Make sure you are accessing the URL printed in the console when running `swa start`!

**ℹ️ NOTE: Make sure to enable debug logs when running any `swa` commands using `--verbose=silly`**

**Describe the bug**
A clear and concise description of what the bug is.

The **swa cli** and Visual Studio debugger no longer connect to the Blazor static web app under Visual Studio 17.8.6.

Under **Visual Studio 17.8.5** the **swa cli** will correctly launch and attach to the browser (in my case Microsoft Edge), however under **Visual Studio 17.8.6** the browser launches however the **swa cli** fails to connect with a 'Failed to launch debug adapter' error (see screenshot below).

Note: When running with **--verbose=silly** the last message is [swa] Connected to tcp:localhost:5000 successfully with no further debug messages.

**To Reproduce**
Steps to reproduce the behavior:

1. Clone the Blazor-Basic SWA from the Microsoft [Quickstart: Build your first static web app](https://learn.microsoft.com/en-us/azure/static-web-apps/get-started-portal?tabs=blazor&pivots=github#create-a-repository) instructions.
2. Update the **BlazorBasic\Properties\launchSettings.json** file by adding "launchUrl": "http://localhost:4280" and changing **applicationUrl** to be "applicationUrl": "http://localhost:5000".

The full launchSettings.json should look like:

{
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:42316",
"sslPort": 44363
}
},
"profiles": {
"BlazorBasic": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": true,
"launchUrl": "http://localhost:4280",
"inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}",
"applicationUrl": "http://localhost:5000",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
"inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
}
}
}

3. Start the **swa cli** with the command swa start http://localhost:5000.
4. Launch the application in Visual Studio with debugging using the **BlazorBasic** profile.

**Expected behavior**
A clear and concise description of what you expected to happen.

The **swa cli** and Visual Studio debugger should connect and launch the Blazor static web app correctly as it did with Visual Studio 17.8.5.

**Screenshots**
If applicable, add screenshots to help explain your problem.

![image](https://github.com/Azure/static-web-apps-cli/assets/13593151/c041165d-542d-42ce-b5c9-54232bc7bce7)

**Desktop (please complete the following information):**

- OS: Windows 11 Pro
- Version 23H2

**Additional context**
Add any other context about the problem here.

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Reproduziere das Problem mit BlazorBasic, launchSettings.json, Visual Studio 17.8.6 und `swa start http://localhost:5000`; vergleiche zuerst das Verhalten mit Visual Studio 17.8.5 und sammle die Ausgabe von `--verbose=silly`. Verfolge die Debugging-Verbindung von `swa start` nach der gemeldeten Meldung tcp:localhost:5000. Als abgeschlossen gilt die Aufgabe, wenn sich die CLI und der Visual Studio-Debugger verbinden und die App erfolgreich starten.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
typescript
Bereich
cli, devtools
Issue-Typ
Bug
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.