Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. Visual Studio
  4. VS 2005 in debug mode highlights blocks of code

VS 2005 in debug mode highlights blocks of code

Scheduled Pinned Locked Moved Visual Studio
visual-studiocsharpdatabasedebugging
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    jack80918
    wrote on last edited by
    #1

    So I'm debugging some C# code in the IDE, stepping thru the lines of code, when it throws an exception. I had breakpoints on the catch code, so the window focus moves to the appropriate catch statement and highlights it as yellow (string strW32 = w32ex.Message) as expected. But what I didn't expect was that the entire set of 3 catch blocks was highlighted light-grey, as if to tell me something. If I could get a VS2005 training class I'd probably know what this means, but no such luck. Also, I cannot query the exception variables in the Immediate window, and a MessageBox.Show in the catch block will not display on the screen. Thanks in advance... catch (System.ComponentModel.Win32Exception w32ex) { string strW32 = w32ex.Message; MessageBox.Show(w32ex.Message); } catch (StackOverflowException soex) { string strSoex = soex.Message; } catch (Exception ex) { string err = ex.Message; }

    Jack80918

    K 1 Reply Last reply
    0
    • J jack80918

      So I'm debugging some C# code in the IDE, stepping thru the lines of code, when it throws an exception. I had breakpoints on the catch code, so the window focus moves to the appropriate catch statement and highlights it as yellow (string strW32 = w32ex.Message) as expected. But what I didn't expect was that the entire set of 3 catch blocks was highlighted light-grey, as if to tell me something. If I could get a VS2005 training class I'd probably know what this means, but no such luck. Also, I cannot query the exception variables in the Immediate window, and a MessageBox.Show in the catch block will not display on the screen. Thanks in advance... catch (System.ComponentModel.Win32Exception w32ex) { string strW32 = w32ex.Message; MessageBox.Show(w32ex.Message); } catch (StackOverflowException soex) { string strSoex = soex.Message; } catch (Exception ex) { string err = ex.Message; }

      Jack80918

      K Offline
      K Offline
      Kamagurka
      wrote on last edited by
      #2

      Hi, try trowing a new exception and catch it elsewhere (where you call the method) passing on the original error message (perhaps include a stacktrace to recognise where things initialy went wrong) kamagurka

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups