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. /d:TRACE compiler flag for enabling tracing?

/d:TRACE compiler flag for enabling tracing?

Scheduled Pinned Locked Moved C#
questioncsharpdebuggingannouncement
5 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.
  • U Offline
    U Offline
    User 2322509
    wrote on last edited by
    #1

    Hello all, regarding tracing everywhere i am coming across this statement: "in order to enable tracing, the /d:TRACE flag must be passed into the C# compiler or the /d:TRACE=True flag must be passed into the VB compiler." I added few trace statements (Trace.writeline..) in my project and compiled solution in "Release" mode without any compiler trace flags and my trace statements are working fine, which means trace statements are being logged. What is the significance of "/d:TRACE" compiler flag? Thanks.

    V H 2 Replies Last reply
    0
    • U User 2322509

      Hello all, regarding tracing everywhere i am coming across this statement: "in order to enable tracing, the /d:TRACE flag must be passed into the C# compiler or the /d:TRACE=True flag must be passed into the VB compiler." I added few trace statements (Trace.writeline..) in my project and compiled solution in "Release" mode without any compiler trace flags and my trace statements are working fine, which means trace statements are being logged. What is the significance of "/d:TRACE" compiler flag? Thanks.

      V Offline
      V Offline
      Vitaliy Tsvayer
      wrote on last edited by
      #2

      I suppose you compile in Visual Studio. Just look at the output window after you compile you project. Visual Studio is adding this flag automatically for you. Search for /define:TRACE

      Vitaliy Tsvayer Tikle

      U 1 Reply Last reply
      0
      • V Vitaliy Tsvayer

        I suppose you compile in Visual Studio. Just look at the output window after you compile you project. Visual Studio is adding this flag automatically for you. Search for /define:TRACE

        Vitaliy Tsvayer Tikle

        U Offline
        U Offline
        User 2322509
        wrote on last edited by
        #3

        I see... thanks for the clarification. So, if we build our solution from command line (say using msbuild...) we should add this flag, right? Thanks.

        V 1 Reply Last reply
        0
        • U User 2322509

          I see... thanks for the clarification. So, if we build our solution from command line (say using msbuild...) we should add this flag, right? Thanks.

          V Offline
          V Offline
          Vitaliy Tsvayer
          wrote on last edited by
          #4

          Yes, you will have to add this flag and possibly some more while using c# compiler from command line.

          Vitaliy Tsvayer Tikle

          1 Reply Last reply
          0
          • U User 2322509

            Hello all, regarding tracing everywhere i am coming across this statement: "in order to enable tracing, the /d:TRACE flag must be passed into the C# compiler or the /d:TRACE=True flag must be passed into the VB compiler." I added few trace statements (Trace.writeline..) in my project and compiled solution in "Release" mode without any compiler trace flags and my trace statements are working fine, which means trace statements are being logged. What is the significance of "/d:TRACE" compiler flag? Thanks.

            H Offline
            H Offline
            Henry Minute
            wrote on last edited by
            #5

            If you double-click the 'Properties' folder for a project in the Solution Explorer, then click on the Build tab, you will see two checkboxes: 'Define DEBUG constant', and 'Define TRACE constant'. If the TRACE one is checked, VS does it all for you, if unchecked, you get no trace.

            Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.”

            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