Help with "TraceSwitch "

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

    #1

    Help with "TraceSwitch "

    I am attempting to use "TraceSwitc h " in Win Forms (Below is the code
    and the app.config). According to the manual, the program should
    read the config for the setting, but this is not occurring. The
    examples in the SDK and on the web appear to match mine, but I am not
    sure if there is an error with my code or some additional setting.

    ====

    The code is:

    static TraceSwitch GeneralTS = new TraceSwitch("Ge neralTS", "Entire
    Application");

    and the App.config is:

    <?xml version="1.0" encoding="utf-8" ?>
    <configuratio n>
    <system.diagnos tics>
    <switches>
    <add name="Trace01" value="1" />
    </switches>
    </system.diagnost ics>
    </configuration>

    Howe

  • John Vottero

    #2
    Re: Help with &quot;TraceSwit ch &quot;

    "David" <martindb@sbcgl obal.net> wrote in message
    news:m23vv1pps0 dd9u4jgtb9sofv4 lnr5i7ebo@4ax.c om...[color=blue]
    >I am attempting to use "TraceSwitc h " in Win Forms (Below is the code
    > and the app.config). According to the manual, the program should
    > read the config for the setting, but this is not occurring. The
    > examples in the SDK and on the web appear to match mine, but I am not
    > sure if there is an error with my code or some additional setting.
    >
    > ====
    >
    > The code is:
    >
    > static TraceSwitch GeneralTS = new TraceSwitch("Ge neralTS", "Entire
    > Application");
    >
    > and the App.config is:
    >
    > <?xml version="1.0" encoding="utf-8" ?>
    > <configuratio n>
    > <system.diagnos tics>
    > <switches>
    > <add name="Trace01" value="1" />
    > </switches>
    > </system.diagnost ics>
    > </configuration>
    >[/color]

    Your trace switch is named "GeneralTS" in the code but it's called "Trace01"
    in your config file. These names must match.


    Comment

    Working...