I have the following launch task in launch.json:
{
"name": ".NET Core Launch (web)",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
// If you have changed target frameworks, make sure to update the program path.
"program": "${workspaceFolder}/MyProject.dll",
[...]
I would also like to run npm run start:dev, when launching, and terminate it when stopping. So I added this:
{
"command": "npm run start:dev",
"name": "Run npm start:dev",
"request": "launch",
"type": "node-terminal",
"cwd": "${workspaceFolder}/ClientApp",
}
But the latter doesn't do anything. Is it possible to run npm run start:dev upon launch together with an MVC Core app?
Related
I installed Flutter and I have a project that used it (Flutter Web).
As IDE I use VsCode.
When I run the app using command line (flutter run --no-sound-null-safety) it works well, instead when I use VsCode I get this error:
ChromeProxyService: Failed to evaluate expression 'Future': InternalError: No frame with index 17.
ChromeProxyService: Failed to evaluate expression 'that': InternalError: No frame with index 17.
...
I launch the app with fn+f5 and I created this .vscode/launch.json file:
{
"version": "0.2.0",
"configurations": [
{
"name": "Web nosound null",
"type": "dart",
"request": "launch",
"deviceId": "chrome",
"args": [
"--no-sound-null-safety"
]
},
{
"name": "Web sound null",
"type": "dart",
"request": "launch",
"deviceId": "chrome",
"args": []
},
]
}
I tried also flutter clean but nothing changes, also uninstall and reinstall Flutter seems not to solve the problem.
VsCode is updated.
What am I wrong?
There are two types of configurations in vscode debugging,
Launch via NPM and Launch via npm
I tried but didn't find the docs anywhere
What's the difference between those?
// #launch via NPM
{
"type": "node",
"request": "launch",
"name": "Launch via NPM",
"runtimeExecutable": "npm",
"runtimeArgs": [
"run-script",
"debug"
],
"port": 9229,
"skipFiles": [
"<node_internals>/**"
]
},
// #launch via npm
{
"name": "Launch via NPM",
"request": "launch",
"runtimeArgs": [
"run-script",
"debug"
],
"runtimeExecutable": "npm",
"skipFiles": [
"<node_internals>/**"
],
"type": "pwa-node"
}
I get an answer from vscode dev: https://github.com/microsoft/vscode/issues/127232
There is no real difference: the launch config with the "port" attribute is contributed by the legacy node.js debugger and will disappear soon. The second launch config is more recent and comes from js-debug.
Since the legacy debug configurations are automatically redirected to js-debug and since port 9229 is the default debug port anyway, there should be no differences.
vscode debugger encounter problem :Cannot find module 'webpack-command', i've installed webpack-cli global, here is my config
{
"type": "node",
"request": "launch",
"name": "node",
"program": "${workspaceFolder}/node_modules/webpack/bin/webpack.js",
"args": ["--config", "./build/dev-server"]
},
I just encountered this error too. I was able to solve it with:
npm install --save-dev webpack-command
For testing my visual studio code extension I need to open a specific folder.
I've inserted the folder path into the args property of Launch Test Configuration as explained here:
{
"name": "Extension Tests",
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": ["${workspaceRoot}/../../RIOT", "--extensionDevelopmentPath=${workspaceRoot}", "--extensionTestsPath=${workspaceRoot}/out/test" ],
"stopOnEntry": false,
"sourceMaps": true,
"outFiles": [ "${workspaceRoot}/out/test/**/*.js" ],
"preLaunchTask": "npm: watch"
}
This works fine if I manually open VS Code and start the test with Debug: Start (F5).
But I want to run tests in batch mode with npm test and this does not work.
How to configure the folder under test when using npm test?
Set the folder under test with CODE_TESTS_WORKSPACE environment variable:
> export CODE_TESTS_WORKSPACE=whatever_folder
> npm test
I'm trying to debug my node script that is running in Visual Studio Code. My first mistake (apparently) was I pressed the Debug menu choice. It launched the .net debugger (this is actually an asp.net core project) but I wanted to debug just the node server that I launched myself.
Now, when I bring up the terminal windows, the only choice seems to be type powershell (see red arrow).
What I want to do is debug my running node script that I started by typing "node start dev".
{
"version": "0.2.0",
"configurations":
[
{
"name": "node",
"type": "node",
"request": "launch",
"stopOnEntry": false,
"program": "${file}",
"cwd": "${workspaceFolder}",
"args": [
"start", "dev"
]
}
]}