/d:TRACE compiler flag for enabling tracing?
-
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.
-
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.
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
-
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
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.
-
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.
Yes, you will have to add this flag and possibly some more while using c# compiler from command line.
Vitaliy Tsvayer Tikle
-
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.
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.”