CodeBetter.Com
CodeBetter.Com
RSS 2.0 via Feedburner
           Do you Twitter? Follow us @CodeBetter

Peter's Gekko

public Blog MyNotepad : Imho { }

Using Firefox (and IE) to debug your apps in Visual Studio

The demand for Firefox is rising. If I may repeat my favourite feature: increasing and descreasing fornt size with ^+ and ^- is a delight for my eyes. Almost saves me from a new pair of glasses. It would be nice to start using FF in Visual Studio when building the app. Which is not that difficult but took some searching. Let me share with you how to set up FF in VS (2003).

  • In the file menu is a “browse with“ option. Select this.
  • Add Firefox to the list of supported browser and check “default“

In the options of your project set “always use IE“ to false

  • That's all.

    Now FF wil be the default browser when you launch your app from VS. Breakpoints and everything work as usual. When your project leans heavely on IE, for instance because you don't want to miss smart navigation, you can instruct VS to keep using IE on a project basis. When you drop IE you also drop the possibility for remote debugging. But that's something I had already given up.

    Peter


  • Published Oct 25 2004, 12:29 PM by pvanooijen
    Filed under:

    Comments

    Ben said:

    THIS IS THE GREATEST TIP EVER. It also stops your code from going to read only...
    # December 6, 2004 11:15 AM

    Raterus said:

    I had to add "Browse With" to my File menu through the following

    Tools | Customize | Commands Tab
    # December 14, 2004 1:24 PM

    andre said:

    I have been trying to do this ever since I left Vs 6 behind. Unfortunately, even after trying these suggestions, I still cannot use FF or Moz to debug VS.NET. When debugging, as soon as FF starts up the debugger immediately unloads. Any ideas?
    # December 16, 2004 2:42 PM

    andre said:

    CORRECTION...to last post.
    The debugger immediately unloads when trying to debug a Web Service usig FF as browser. WEb Applications DEBUG FINE! Peter your my hero of the day...
    # December 16, 2004 2:46 PM

    andre said:

    CORECTION TO CORRECTION..
    I was so happy for a minute...
    I just noticed that it was iE that had launched. FF still has same problem. Debugger unloads as soon as FF is launched. :(
    Still hoping for a solution....
    # December 16, 2004 2:49 PM

    Peter's Gekko said:

    Debugging a webservice with Firefox
    # December 21, 2004 12:54 AM

    spakinz said:

    i don't have the option 'browse with..'. Which version of vs 2003 do you have?
    # December 23, 2004 10:31 AM

    Peter van Ooijen said:

    # December 23, 2004 12:25 PM

    Scott Elkin said:

    # January 4, 2005 8:48 PM

    Tim Haines said:

    This doesn't work for me either. I have the same problem as Andre. When Firefox starts the debugger quits. It probably just needs tweaking in some small way - pass as to what it might be though.
    # January 5, 2005 1:46 AM

    Peter van Ooijen said:

    Hi Tim,
    have you read http://dotnetjunkies.com/WebLog/petergekko/archive/2004/12/21/38013.aspx ?

    When the app has started use "Attach to process" <ctrl><Alt>P
    # January 5, 2005 2:34 AM

    Micke said:

    FF debugging works fine for me. Can trace into code, use break points ...

    Using FireFox 1.0.1
    # April 7, 2005 3:42 AM

    Thomas said:

    I tried this as well. I went up to "File" > "Browse With", and gave it a shot.

    Hitting the Debug button caused Visual Studio to start up FireFox with my app loaded. However, as soon as it does this, the debugger stops.

    One interesting sidenote. After doing the above, I noticed the "Browse With" command had mysteriously been removed from my "File" menu. WTF? I used the suggestion in the previous comments to add it back to the menu.

    WOW.
    # June 15, 2005 2:13 PM

    Les Matheson said:

    It does seem that the "Browse with..." option isn't always on the File menu -- on my VS 2003, it shows up if I right-click a .aspx file in Solution Explorer. Its also available in the large list of functions in the File section of /Tools /Customize /Commands.
    # July 6, 2005 7:41 AM

    Shane Henderson said:

    If you want breakpoints and stepping through code to work with Firefox you have to close all instances of Firefox before you run in debug mode. Then when you debug a web application through VS.NET and it launches a window everything will work. If you have any other browser instances of Firefox open VS will not attach to the process.
    # July 19, 2005 1:10 PM

    aaaa said:

    thanks for help - my vs 2005 beta lunched firefox but I wanted to check how it looks in IE. It worked :)
    # September 2, 2005 10:43 AM

    Nazmundo said:

    xlnt tip peter thanks .... couple this with the http://chrispederick.com/work/webdeveloper/
    web developer extension and were all on our way to creating accessible standards compliant asp.net web apps! (well almost)
    # September 27, 2005 10:24 AM

    Sarel j said:

    I know that this is off topic but could someone please help me? I have 2 datagrids:dgModels and dgFavorites. The idea is that all the models that you select should be added to dgFavorites on postback.

    This works great with IE but Firefox does not recognize the postback??? The isPostback does not register in Firefox.


    Please help!!
    # October 3, 2005 3:29 AM

    pvanooijen said:

    IsPostBack is a server-side feature. I don't think your problem has to do with FF itself, but rather by it's settings. Did you disable session, cokkies or something like that ?
    # October 4, 2005 2:41 PM

    Sarelj said:

    Re: the firefox and postback problem. Thanks for that tip... It did not help but made me think. You are right, it is a browser problem and not a server proble. I do have cookies enabled for all sites. Where do I disable sessions in FF?? I still think that it might be something else??
    # October 11, 2005 8:20 AM

    Sham said:

    BIGGGG THANKS !!!
    # July 4, 2006 8:54 AM

    Phi Nguyen said:

    There is an option in Firefox that let you open a new browser window if links are from other apps. This would let you use Firefox as both your regular browser and for debugging as well
    # August 16, 2006 10:45 AM

    Jovi said:

    If firefox detaches, click on disable script debugging in the advanced tab of internet options in IE.

    # January 19, 2007 2:10 PM

    Roger said:

    Wow ! at least ! I use firefox as my default browser but I wanted to use IE for debug, but it was impossible till now to find on internet how to stop vs to launch firefox when I started to debug my site. THANKS

    # January 10, 2008 5:31 PM

    Leave a Comment

    (required)  
    (optional)
    (required)  

    Enter the numbers above:
    Add
    Check out Devlicio.us!