VS Code launch.json attach to iexplore - visual-studio-code

I would like to debug my office-js application (with angular2) within VS-Code.
My launch.json is:
"configurations": [
{
"sourceMaps": true,
"type": "node",
"request": "attach",
"port": 4200,
"name": "Launch Program",
"outFiles": [
"${workspaceRoot}/*.js"
]
}
Currently I'm using Atom Editor with angular cli and "ng serve" command and VS Community Edition 2017 as debugger. It works with "Attach to Process" (iexplore) and I'm able to debug my Word AddIn.
For simplification I tried to move to VS-Code which -for my understanding- supports inline debugging.
In launch.json, "type" could be "node", "chrome", "edge", "firefox" but I didn't found iexplore which I would need in my opinion.
Thank you in advance for sharing your expierences.

There are a number of debuggers in the extension marketplace but I'm not aware of one for Internet Explorer.

Related

Debug mode does not activate breakpoint

I am trying to use debug mode in my react native application with visual studio code. I am using the command npx react-native run-android. It is activating the react native debugger, but it is not reaching any breakpoint in my application.
I did not find any tutorials to activate debug with npx, so could you guys show me one or explain me what is happening wrongly in this setup?
this is my launch.json
{
"version": "0.2.0",
"configurations": [
{
"name": "Debug React Native",
"program": "${workspaceRoot}/.vscode/launchReactNative.js",
"type": "reactnative",
"request": "launch",
"platform": "android",
"sourceMaps": true,
"outDir": "${workspaceRoot}/.vscode/.react"
},
]
}
An interesting thing it is happening is once it is running the application if I click on the start debugging button my application restarts and it shows a message on debug console:
Launched debug configuration contains 'program' property which is deprecated and will be removed soon. Please replace it with: "cwd": "${workspaceFolder}"
Could not debug. The "path" argument must be of type string. Received type undefined
Since I have not received any answer, I took 3 days to discovered what was happening.
this is the correct configuration:
{
"version": "0.2.0",
"configurations": [
{
"name": "Attach to packager",
//"program": "${workspaceRoot}/.vscode/launchReactNative.js",
"type": "reactnative",
"request": "attach",
"sourceMaps": true,
"cwd": "${workspaceFolder}",
//"outDir": "${workspaceRoot}/.vscode/.react"
},
]
}
Must run the command npx react-native run-android
Once the android emulator is running batch job must be stopped in the terminal
Go to the debug tab in vs code and run the application
ctrl + m on android emulator
click on debug option
Those were the baby steps that I did in order to have the application run in debug mode.

F# with VS Code : Redirecting user input

I use Visual Studio Code 1.37.1, OS Windows 10. I have installed F# with Ionide.
How can I launch the code to redirect user input to a file as I would do with Visual Studio 2019 ("< in.txt" in CommandLineArgs Option of the debugger).
Thank you !
It is related to this and not F# specific.
In launch.json
{
"name": "someName",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"program": "${workspaceFolder}/path/to/someName.dll",
"args": ["<", "${workspaceFolder}/path/to/file.txt"],
"console": "internalConsole",
}
works with internalConsole for me.

Debugger for Chrome: ERR_CONNECTION_REFUSED

Windows 10 x64 Professional
Visual Studio Code v1.26.1
Debugger for Chrome 4.9.0
I have the simple config (launch.json):
{
"version": "0.2.0",
"configurations": [
{
"type": "chrome",
"request": "launch",
"name": "Launch Chrome against localhost",
"url": "http://localhost:8080/index.html",
"webRoot": "${workspaceFolder}"
}
]
}
The launch.json file is located in the .vscode subdirectory of my project folder. Also my folder contains the index.html file.
I open my project folder in Visual Studio Code and press F5 key, but I get the ERR_CONNECTION_REFUSED error in the new Google Chrome instance. I.e. the browser can't to open my index.html page.
But this variant works fine:
{
"version": "0.2.0",
"configurations": [
{
"type": "chrome",
"request": "launch",
"name": "Launch Chrome against index.html",
"file": "${workspaceFolder}/index.html"
}
]
}
Why I have the problem with the localhost variant and how can I solve it?
I had the same problem this week. As far as I understand the first launch config (using URL and webroot) needs a local (f.i. node.js) web server up and running.
The second launch config "just" runs the local file(s).

Debugging Node with Visual Studio Code (not powershell)

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"
]
}
]}

VSCode and remote debugging in Chrome Developer Tools

Are there any step by step instructions for beginners to be able to see the output of VSCode code runs in Chrome Developer Tools?
Here is what I have done:
Installed "Debugger for Chrome" 3.1.7 extension with VSCode - extension installed OK, along with Live Server 1.6.7. Launch.json file shows up as below. However, even if I restart Chrome and VSCode, I can't see any logs in Chrome Developer tools.
Thanks!
{
"version": "0.2.0",
"configurations": [
{
"type": "chrome",
"request": "launch",
"name": "Launch Chrome against localhost",
"url": "http://localhost:8080",
"webRoot": "${workspaceRoot}"
},
{
"type": "chrome",
"request": "attach",
"name": "Attach to Chrome",
"port": 9222,
"webRoot": "${workspaceRoot}"
}
]
}