iisnode
iisnode copied to clipboard
Can't make the "--inspect" flag work with web.config parameter
I am using your IIS Node component to run NodeJS on my IIS server.
I have set the "nodeProcessCommandLine" parameter to "node.exe --inspect", so this way I could set up the inspect, and then attach my VSCode to it for debugging purposes.
I am expecting this works anytime, and that I should be able to check if the process is correctly running with a command like "netstat". However, I am not able to attach VSCode to the process everytime. In fact, sometimes it works (after restarting IIS multiple times) and sometimes it doesn't.
Is there a way to check how NodeJS is running ? On which port, or at least debug the command line used by IIS to run Node ?
I have already been able to debug, but the fact it is inconsistent makes me wonder if it wasn't just "luck". I wonder if, when it worked, the "--inspect" flag selected the port I am using for debugging (9229) some times, but not always. I always tried "node.exe --inspect=9229" but I can't always attach, neither can I check the process running on port 9229 with netstat (nothing shows up).
Any ideas ? Thank you
Any solution yet?
Hey Guys,
Was facing the same issue until now but kind of figured out a way to this problem.
<iisnode node_env="development" debuggingEnabled="true" devErrorsEnabled="false" nodeProcessCountPerApplication="1" debuggerPathSegment="debug" nodeProcessCommandLine="node --inspect" watchedFiles="web.config;<path-to-your-server-file>/index.js"/>
hope this helps.