VS2008 debugging with firefox as default browser - how to make the debugger stop/close on exit? - visual-studio

I have Firefox as my default browser on my dev machine and when I start debugging from visual studio Firefox launches as I would expect and all the attributes of the experience are the same as IE except for one thing - when I close the browser. When using IE, when I close the browser visual studio will automatically shut down the debugger. When I close FF I do not get this behavior - does anyone know how to make this happen?

The reason for this behavior is very simple: Visual Studio attaches itself to the process to be debugged, and will drop out of run mode if it sees that process terminate. FireFox does not create a new process every time a window is launched: it reuses the existing process. IE is able to create a new one for each window (depends on option settings). If you already have FF running and you launch an app to be debugged, the app window is created in the existing process and VS attaches to that process. When you close the app window the process doesn't terminate because it is still active for the pre-existing windows. Next time it happens close all the other FF windows and you will see Visual Studio drop out of debug run mode. If there was a way to tell FireFox to create a new process for a new window then this problem would go away. I haven't found any reasonably reliable way to do that.

To add to Mark's answer, you can setup a specific "debug" profile for firefox, and then change the project's properties/Web, select there "start external program" and browse to firefox.exe, and set commandline arguments to '-no-remote -P "MyDebugProfile" '.
To manage your profiles, start (from command-line) firefox like this:
c:\> <installation path of ff>\firefox.exe -profilemanager
There, you create a new profile (lets say "debug")
To start a new process of FF with this profile (i.e. what you set for VS):
c:\> <install path to ff>\firefox.exe -no-remote -P "debug" "http://mysite"
Note, that the "-P" parameter is case sensitive.

Right click on any .aspx page and choose the option "Browse With..." there you can setup the default browser

Try attaching the debugger to the FireFox process instead!
In VS (2008) select the Menu option Debug -> Attach to Process and then select firefox.exe - if you don't see this process you may have to ensure 'Show processes in all sessions' is checked.
I ran this and verified that it does work. I also verified that closing FireFox via app debug does not work, if you Firefox is set as the default browser in VS 2008.

Related

Prevent STS4 from launching browser when run?

I have a Spring Boot application with only api rest calls.
Everytime I press the "run on server" button a browser is launched trying to access the current file. Of course it always prompt an error:
Sorry for the image being in Spanish. It basically says that cannot download the resource.
My question is how to avoid this browser from launching everytime I run my application.
Thanks.
I found the solution to my problem. Here is what I did:
Go to Window > Preferences > General > Web Browser > New...
Add a new browser with:
name = NO BROWSER (or whatever you want)
location = C:\Windows\System32\cmd.exe
parameters = /c
Press OK.
Finally select Use external web browser, select the browser we just added and press Apply and Close.
The browser configuration should look like this.
Instead of using the cmd you could use a batch/shell script that does nothing (without the /c parameter which is only needed for the cmd to do nothing).
NOTE: This solution is applied to the IDE not to the project.

Managing windows when local SAS session starts

When a SAS session starts, there are 5 windows. (Result Viewer, Explorer, Log, Editor, Output).
My desired state is when the session starts:
No result viewer
No output window
No default explorer window
The useable explorer window default open(to clarify this i attached a picture)
Good/Bad explorer window
Enchanced editor open
Log window open
So there will be 3 windows opened at session start, and i would like to resize them into 3 columns.
What i got so far:
I know the task can be done, because i was able to do this on my working computer. Unfortunately they reinstalled my windows without a word, and i lost my setup. And i did not have my autoexec/sasv9cfg file backuped. :(
I can close the output window with dm listing off command in my autoexec.
I can resize the 3 windows if i have them, with dm wdef command as well.
My biggest issue is i cant find again a DM/ODS or any kind of command, which closes the Result Viewer, and the original Explorer, and opens the normal/usable Explorer. In my faded memories i needed only 1 DM/ODS/sth command to achieve these 3 steps at once. Of course, if we can find a solution in more steps, thats also completely fine.
Big thx for any kind of help
You do not want the DMSEXP docked windows (which includes ODS Results tab) at session start up. The only way to do this programmatically is to specify the SAS system option -nodmsexp in the sas.exe command line or config.sys.
So, on my system, I set the target command on my SAS icon to be:
"C:\Program Files\SASHome\SASFoundation\9.4\sas.exe"
-CONFIG "C:\Program Files\SASHome\SASFoundation\9.4\nls\en\sasv9.cfg"
-NODMSEXP
Tweak the SAS DM session window states by placing this code in your autoexec.sas
dm 'dmsexp;tree on;next;listing off;tile vert' ;
You can also fiddle around with your session start up using the system options:
initstmt=
initcmd

Firefox new debugger - Where did the file tab go?

Feel really stupid for asking but where did the file tabs in the debugger go? I can only open one file at a time. If I try to open another one, the file content is simply replaced with the new file. If I revert back to the old debugger, then I have a file tab for each file I open.
Using Firefox 53.0.3 (64-bit) on Ubunto 16.04LTS
You're actually using the old debugger UI. It's the new frontend that allows to open several files at the same time and looks like this:
To toggle the new debugger UI, go to about:config and set the preference devtools.debugger.new-debugger-frontend to true.
You may also check whether browser.tabs.remote.autostart.2 is set to true, which controls whether Firefox runs in multi-process mode.

Reuse window / tab when file is already open

I want to set a global shortcut that will open a certain file. When there already is a gvim window that has that file open, I want it to focus on that window, and select the tab with that file. If there isn't, I want it to be opened in a new gvim window, regardless of whether there already are other gvim windows.
I can do part of this with --remote and --servername, but I can't find a way to detect whether there already is a remote server running with the name I use, so I can't quite get everything to work together to come to what I described above.
OK, turns out most can be done using the default behavior of --remote-silent. The whole setup is a matter of making an AutoHotkey script like this:
#!^+1::
Run "c:\Program Files (x86)\vim\vim74\gvim.exe" --servername org --remote-silent %DROPBOX%\org\TODO.org
WinActivate, TODO.org
Return
AHK is needed for the global hotkey as well as activating the window; vim (using --servername and --remote-silent) will start a new session called 'org' if there isn't one yet, and start it otherwise. It even gets the tab activation right when there already is a server called 'org' but if that server has another tab active.

Visual Studio Command Window - Attach To Remote Process?

I was wondering if it is possible to use the command window commands to attach to a remote process? (It gets very annoying for remote debugging to roll through the dialog steps every time.)
I don't think there's any way to do what you want from the command line. But you should be able to eliminate at least some of the dialog steps.
For example, for C++, in the Project Properties find the Debugging Tab and change "Debugger to launch" to "Remote Windows Debugger". Now change Remote Command to the name of the process you want to attach to, change Remote Server Name to the relevant host name and change Attach to 'yes'. You can also set other properties as desired.
Press F5 (or Debug | Start) and you should end up attached to the process you identified on the remote server you identified.

Resources