Debug or Release mode ?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • JezB

    #1

    Debug or Release mode ?

    Any way I can programatically test whether my (c#) code is running in Debug
    or Release mode ? I want to load a smaller dataset when running in debug,
    for testing purposes.


  • Hans Kesting

    #2
    Re: Debug or Release mode ?

    JezB wrote:[color=blue]
    > Any way I can programatically test whether my (c#) code is running in
    > Debug or Release mode ? I want to load a smaller dataset when running
    > in debug, for testing purposes.[/color]

    there is "conditiona l compilation":

    #if DEBUG
    // some code that is only compiled/executed in debug-mode
    #else
    // some code that is only compiled/executed in release-mode
    #endif

    Hans Kesting


    Comment

    • Carlos J. Quintero [.NET MVP]

      #3
      Re: Debug or Release mode ?

      You can use the DEBUG conditional compilation constant:

      #if (DEBUG)
      // This is only executed in Debug configuration

      #endif
      --

      Best regards,

      Carlos J. Quintero

      MZ-Tools: Productivity add-ins for Visual Studio .NET, VB6, VB5 and VBA
      You can code, design and document much faster.
      Free resources for add-in developers:
      MZ-Tools has a single goal: To make your everyday programming life easier. As an add-in to several Integrated Development Environment (IDEs) from Microsoft, MZ-Tools adds new menus and toolbars to them that provide many new productivity features.


      "JezB" <jezbroadsword@ blueyonder.co.u k> escribió en el mensaje
      news:OOwduKFYFH A.1240@TK2MSFTN GP14.phx.gbl...[color=blue]
      > Any way I can programatically test whether my (c#) code is running in
      > Debug
      > or Release mode ? I want to load a smaller dataset when running in debug,
      > for testing purposes.
      >
      >[/color]


      Comment

      Working...