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
  1. Home
  2. General Programming
  3. C#
  4. Detecting The Debug Version

Detecting The Debug Version

Scheduled Pinned Locked Moved C#
questionannouncementdebuggingtutorial
4 Posts 3 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.
  • B Offline
    B Offline
    BlitzPackage
    wrote on last edited by
    #1

    Good people, How do I use the preprocessor "#if" to detect whether my app is running in debug or release mode? (I know, I'm embarrassed to ask.   Here, I've built an entire app and don't know how to detect debug mode. Doh!) Thanks, Blitz

    L L B 3 Replies Last reply
    0
    • B BlitzPackage

      Good people, How do I use the preprocessor "#if" to detect whether my app is running in debug or release mode? (I know, I'm embarrassed to ask.   Here, I've built an entire app and don't know how to detect debug mode. Doh!) Thanks, Blitz

      L Offline
      L Offline
      Luc Pattyn
      wrote on last edited by
      #2

      Hi, by default a debug build has DEBUG and TRACE predefined, whereas a release build has not. However you can change these settings (and predefine other symbols) in the build tab of the project properties. :)

      Luc Pattyn [Forum Guidelines] [My Articles]


      The quality and detail of your question reflects on the effectiveness of the help you are likely to get. Show formatted code inside PRE tags, and give clear symptoms when describing a problem.


      1 Reply Last reply
      0
      • B BlitzPackage

        Good people, How do I use the preprocessor "#if" to detect whether my app is running in debug or release mode? (I know, I'm embarrassed to ask.   Here, I've built an entire app and don't know how to detect debug mode. Doh!) Thanks, Blitz

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        #if DEBUG code goes here #endif easy as that!

        ___________________________________________ .\\axxx (That's an 'M')

        1 Reply Last reply
        0
        • B BlitzPackage

          Good people, How do I use the preprocessor "#if" to detect whether my app is running in debug or release mode? (I know, I'm embarrassed to ask.   Here, I've built an entire app and don't know how to detect debug mode. Doh!) Thanks, Blitz

          B Offline
          B Offline
          BlitzPackage
          wrote on last edited by
          #4

          Thank you all so much.   I appreciate it.

          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