How do I get my Jscript Debugger to Attach to a Process? - debugging

I get the following JScript Debugger error when I click on the Start Debugging button in the Script tab of the Developer Tools (F12) window:
Unable to attach to the process. Another debugger might be attached to the process.
Closing all browser windows and launching ie again has no effect.Ending the process tree in Windows Task Manager and starting a new iexplore task has no effect.Hitting Shift-F5 when in the Developer Tools window has no effect.Rebooting the entire machine reveals how desperate I am and has no effect.Searching in Regedit's [HKEY_LOCAL_MACHINE\SOFTWARE] branch for "JITDebug" just reveals I don't know what the hell I'm looking for.

I find that I experience this problem when launching a site in debug mode from Visual Studio.
If you would like to use the debugger in Internet Explorer Developer Tools you would need to launch the site outside of Visual Studio.

Related

Visual Studio: Attaching the Webkit debugger to process chrome.exe on machine failed

I have installed Visual Studio 15 Preview 5 on my machine. Whenever I run a project with any browser other than Google Chrome it runs graciously. But whenever try to run with Google Chrome it cannot run the project stating as follows:
Attaching the Webkit debugger to process chrome.exe on machine "TanvirArjel" failed.
In the browser tab it shows as follows:
Any idea how to fix this issue??
Go to Debug → Attach To Process, and change "Attach To:" to "Native Code".
Stop debugging.
Edit csproj.user file
Find section wrote below:
<SilverlightDebugging>True</SilverlightDebugging>
Change Value to "False"
Unload and reload your project in Visual Studio.
Sometimes it needed to close Visual Studio.

How to close a crashed Visual Studio debugger?

I feel pretty ridiculous having to ask this, but is there an easy way to close Visual Studio while it's debugging?
I'm debugging my application, and when switching to full screen it crashes. I am unable to alt-tab to visual studio to stop the debugger, and I'm unable to pull any other windows on top of the full screen application.
I can, however, see the start bar. I can right click on visual studio and click close, but it does nothing (same goes for the debugging application).
I'm unable to get the task manager to show in front of the full screen application.. However, I'm on Windows 8 and I've noticed the Metro interface still works (and all metro apps). If I could find a little command prompt metro app I'm sure I could get around this, but I'm unable to.
Is there an easier way to resolve the issue without having to restart my pc each time I crash?
Almost forgot to mention, I'm on Visual Studio 2013
Edit: Forgot to mention, I'm programming on-the-go on a laptop; I only have the one monitor for this situation
I found a solution:
I can toggle focus to Visual Studio via Windows' Alt-Tab hotkey. This won't bring up Visual Studio, though.
Usually the problem is an unhandled exception, which requires me to hit "break." Since I gave Visual Studio focus, I can hit enter to select break.
I then use the Shift+F5 hotkey to stop the debugger
You might be able to use Developer Command Prompt - see MDbg.exe (.NET Framework Command-Line Debugger) to debug and kill your process

Visual Studio: How can I start the development server WITHOUT opening a browser window or seeing a warning?

Visual Studio 2010 Professional
So I want to be able to "Start Debugging (F5)" or "Start Without Debugging (Ctrl + F5)" without a) Opening a browser window or b) Getting an error message from Visual Studio
I tried the following:
Setting "Start Action" to "Don't open a page. Wait for a request from an external application"
This works great for debugging, however if I start without debugging I get this error message every time:
Setting "Start Action" to an external program that doesn't do anything. This works great for starting without debugging, however if I try and debug then the debugger starts and stops immediately.
I don't even understand that VS error message. I'm "Starting Without Debugging"... of course there's nothing to debug! Stop bothering me!
Thanks in advance!
I can provide a workflow that only opens a browser window when you first start a development session. I know you don't want to open a browser window ever. If this is a workflow preference, then I have found the solution below good-enough for myself.
I keep the start action as 'Current Page'. When starting a development session, I use 'Start Without Debugging' to start the ASP.NET Development Server, and a web browser. I close the web browser, but the Development Server remains running and continues to server requests for your application.
If the debugger is not attached, and I make a code change, the I use 'Build Solution (F6)' to rebuild, and the Development Server uses the newly built binaries. Changes to views are automatically detected and re-compiled.
To debug, I use Debug -> Attach to Process (CTRL + ALT + P for me) and find the correct running WebDev.WebServer40.EXE process based on the port.
The Development Server remains running as long as the solution remains open in Visual Studio.

How to debug IE9 HTA?

Has anyone gotten a debugger attached to mshta.exe after installing IE9? (64bit or WOW64)
If you have Visual Studio, go to Tools -> Attach to Process and attach to the MSHTA.EXE process. Then pick Script as the target to debug.
I'm on a Vista x64, so I have to contend with the 32bit/64bit barrier.
HTA
c:\windows\system32\mshta.exe
(mshta32)
c:\windows\syswow64\mshta.exe
(mshta64)
Launching
"mshta32 foo.hta" may use mshta32 or mshta64 depending on what is associated with HTA
the same goes if "mshta64 foo.hta" is used
"cmd /C start foo.hta" would have the same affect.
Debugger
MS Script Editor (from Office XP/2003) for JS debugging in IE/HTA
Normally I would use the debugger keyword to initiate the launching of the debugger, however with IE9, it doesn't seem to do that anymore. I must launch the debugger first, attach to the mshta.exe process manually (only supports 32bit). Then everything appears to work fine!
EDIT:
With coworkers, different machine have exhibited different behaviors:
debugger keyword works fine
Connecting to MSHTA.EXE from the debugger doesn't work
I haven't yet found a silver bullet.
Try using 'Stop' statement. This should raise the debugger dialog
I had the same problem. Finally pieced together how to debug using Visual Studio from two sources
Turn on script debugging through Internet Explorer, as described here and here
Start up Visual Studio. Click on Debug -> Attach to Process
Run the .hta file and select the running process from the Attach to Process dialog

How do I keep the development web server (Cassini) running in Visual Studio 2008?

I'm using Visual Studio 2008 to develop ASP.NET applications. Currently I'm debugging with running on IIS. I would like to switch to the development web server (Cassini) for debugging, so that I can use features like edit and continue. The reason that I'm not, is because the development web server only starts up when you are in debug mode. Is there any way to keep it running all the time, and just have Visual Studio attach to the existing server process like it does with IIS?
Rihan is partially correct...
In your Project Property page, Web tab: Enable Edit and Continue
If checked - The Development server will close when the app (not VS) stops.
If unchecked - Development server keeps running
You can also start your cassini server from the command line which takes alot of pain out of the whole "debug" effort...
Check out a good snippet here on how to do this: https://thoughtjelly.wordpress.com/2009/05/13/launch-cassini-from-the-command-line/
Once started, the built-in web server continues executing even when you stop debugging, as long as your VS2008 project is still open. Just start up the debugger when you want to start debugging again. I typically have another browser window open and interact with the built-in web server from there instead of the browser window that it opens so I can keep working with the application in the same state even after turning off the debugger (which closes the opened browser window).
I'm running VS2008 on Windows XP SP3.
The simplest way I have found to acheive that is by launching the debugger as normal. Then in Visual Studio goto the Debug menu, and select detach all. It detaches from the Cassini web engine, but it does not shut it down, as it does when stopping debugging.
I am quite sure you are know that there is command line swithces that you can you use to launch the cassini engine, but my guess is you are looking for something slightly easier.
Detaching does not close the browser window that visual studio launched, and if you do close that spesific web window then it will stop debugging.
I am running VS 2008 SP1 on Vista 64x SP1 without IIS.
Hope it helps
Rihan Meij
I have 3 web sites, with Single sign on between each site so I need to start all 3 with attach to process. However, there was no process to attach the debugger to, and whenever I started a project with F5 then stop it, the visual studio web server closed.
The Enable Edit and Continue option didn't change anything.
So to start the web server and keep it running so that you can attach the web project to the process, I simply did a "view in Browser" (ctrl+shift+W). This started the server process but not the project nor the debugger. I could then attach to process easily.
In Visual Studio 2015 you do this by going to Tools > Options > Debugging > General and unchecking the "Enable Edit and Continue" option:

Resources