Re: Debug.Print Release ?



2 things:

1 In "Project - Properties - Compile", I see no "Advanced Compile
Options"

2 The IDE informs me that Print is not a member of Trace

Bill

Jay B. Harlow [MVP - Outlook] wrote:
> Bill,
> Rather then attempt to expose the Debug object for Release builds, I would
> recommend you use Trace.Print instead. As the Trace object is normally
> enabled in Release builds, while Debug is only enabled in Debug builds.
>
> If you really want the Debug object in Release Builds you can use "Project -
> Properties - Compile - Advanced Compile Options - Define DEBUG constant" to
> define the DEBUG compile time constant.
>
> NOTE: "Define DEBUG constant" will enable all conditional code that uses the
> Debug constant. Whether this code is using #if Debug or
> <Conditional("Debug")>
>
> FWIW: The System.Diagnostics.Debug (Debug.Print) has a
> <Conditional("Debug")> attribute on it, you can apply the same attribute to
> your code to achieve the same effect...
>
> --
> Hope this helps
> Jay [MVP - Outlook]
> .NET Application Architect, Enthusiast, & Evangelist
> T.S. Bradley - http://www.tsbradley.net
>
>
> <swartzbill2000@xxxxxxxxx> wrote in message
> news:1136397022.252378.301120@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> | Hello,
> | I have a VB 2005 Express project with a TraceListener-derived class to
> | route Debug.Print output to a log file. It works fine for Debug builds.
> | What is the correct combination of changes to make it work in Release
> | build?
> | Bill
> |

.



Relevant Pages

  • Re: viewing ajax source
    ... bill wrote: ... To debug the problem I need to see the source that the AJAX script is returning. ... I have a debug div that the script returns the data to, but I can't figure out a way to see exactly what is being returned. ... Ubuntu 9.04 server Apache ...
    (comp.lang.javascript)
  • Re: Debug.Print Release ?
    ... Bill, ... Rather then attempt to expose the Debug object for Release builds, ... If you really want the Debug object in Release Builds you can use "Project - ... "Define DEBUG constant" will enable all conditional code that uses the ...
    (microsoft.public.dotnet.languages.vb)
  • How to turn of LNK Warning
    ... debugging information for referencing module; linking object as if no debug ... Bill ...
    (microsoft.public.dotnet.languages.vc)
  • Re: 70-316 unsure of the question
    ... Tracing is enabled by default for both Debug and Release builds. ... Trace is enabled by default. ... Change the .config file in the local machine and add an entry for the ...
    (microsoft.public.cert.exam.mcad)
  • Re: Anyone know how to add a "Debug window" in own app
    ... debug messages in a release build using Trace.WriteLine or Console.WriteLine ... > Because TRACE is defined in Release builds by VS.NET. ... > the people who use your code won't alter the config file? ... > config file will enable the default trace listener.) ...
    (microsoft.public.dotnet.framework)

Loading