You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Open the Command Palette using `Ctrl+Shift+P` and run `Debug: Add Configuration...`. This will ask you to choose a debugger; select `Ionide LaunchSettings`.
76
+
#### Debug the Server
78
77
79
-
This will create a `launch.json` file in the root of your solution and also open it in the editor.
78
+
1. Click the debug icon on the left hand side, or hit `ctrl+shift+d` to open the debug pane.
80
79
81
-
#### 2. Update the Configuration
82
-
The only change required is to point it at the Server application, by replacing the `program` line with this:
* From the Command Palette, choose `Tasks: Configure Task`.
90
-
* Select `Create tasks.json file from template`. This will show you a list of pre-configured templates.
91
-
* Select `.NET Core`.
92
-
* Update the build directory using `"options": {"cwd": "src/Server"},` as shown below:
93
-
94
-
```json
95
-
{
96
-
// See https://go.microsoft.com/fwlink/?LinkId=733558
97
-
// for the documentation about the tasks.json format
98
-
"version": "2.0.0",
99
-
"tasks": [
100
-
{
101
-
"label": "build",
102
-
"command": "dotnet",
103
-
"type": "shell",
104
-
"options": {"cwd": "src/Server"},
105
-
"args": [
106
-
"build",
107
-
"debug-pt3.sln",
108
-
// Ask dotnet build to generate full paths for file names.
109
-
"/property:GenerateFullPaths=true",
110
-
// Do not generate summary otherwise it leads to duplicate errors in Problems panel
111
-
"/consoleloggerparameters:NoSummary"
112
-
],
113
-
"group": "build",
114
-
"presentation": {
115
-
"reveal": "silent"
116
-
},
117
-
"problemMatcher": "$msCompile"
118
-
}
119
-
]
120
-
}
121
-
```
80
+
2. In the bar with the play error, where it says "No Configurations", use the dropdown to select ".NET 5 and .NET Core". In the dialog that pops up, select "Server.Fsproj: Server"
122
81
82
+
3. Hit F5
123
83
124
-
#### 4. Debug the Server
125
-
Either hit F5 or open the Debugging pane and press the Play button to build and launch the Server with the debugger attached.
126
-
Observe that the Debug Console panel will show output from the server. The server is now running and you can set breakpoints and view the callstack etc.
84
+
The server is now running. You can use the bar at the top of your screen to pause, restart or kill the debugger
127
85
128
86
#### 5. Debug the Client
129
87
130
-
* Start the Client by running `dotnet fable watch -o output -s --run npm run start` from `<repo root>/src/Client/`.
131
-
* Open the Command Palette and run `Debug: Open Link`.
132
-
* When prompted for a url, type `http://localhost:8080/`. This will launch a browser which is pointed at the URL and connect the debugger to it.
133
-
* You can now set breakpoints in the generated `.fs.js` files within VS Code.
134
-
* Select the appropriate Debug Console you wish to view.
88
+
1. Start the Client by running `dotnet fable watch -o output -s --run npx vite` from `<repo root>/src/Client/`.
89
+
2. Open the Command Palettek using `ctrl+shift+p` and run `Debug: Open Link`.
90
+
3. When prompted for a url, type `http://localhost:8080/`. This will launch a browser which is pointed at the URL and connect the debugger to it.
91
+
4. You can now set breakpoints in by opening files via the "Loaded Scrips" tab in the debugger; setting breakpoints in files opened from disk does NOT work.
135
92
136
93
> If you find that your breakpoints aren't being hit, try stopping the Client, disconnecting the debugger and re-launching them both.
0 commit comments