Support > Samples > Get Started

Get Started

Download source code

Step1: Configure your application
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <configSections>
    <section
            name="traceManagement"
            type="Css.Diagnostics.TraceManagementSection, 
                Css.Diagnostics.TraceComLib" />
  </configSections>
  <traceManagement mode="On">
    <publishers>
      <publisher key="TraceSvrPublisher1" mode="On" 
                 assembly="Css.Diagnostics.TraceComLib" 
                 type="Css.Diagnostics.Publishers.TraceSvrPublisher">
        <attributes>
          <attribute name="url" 
                     value="tcp://localhost:13400/TraceSvr.rem" />
        </attributes>
        <filters>
          <filter type="*" level="4"></filter>
        </filters>
      </publisher>
    </publishers>
    <filters>
      <filter type="*" level="4"></filter>
    </filters>
  </traceManagement>
</configuration>
Step 2: Reference Css.Diagnostics.TraceComLib
Step 3: Make your console application look like
using System;
using Css.Diagnostics;
using System.Runtime.Remoting;

namespace Css.Coyote.Samples.GetStarted
{
    class Program
    {
        static void Main(string[] args)
        {
            RemotingConfiguration.Configure
                (System.IO.Path.Combine(
                      AppDomain.CurrentDomain.BaseDirectory
                    , AppDomain.CurrentDomain.SetupInformation.ConfigurationFile)
                    , true);

            Exception ex = new Exception("If you read this, everything works fine ;-)");

            try
            {
                throw ex;
            }
            catch (Exception)
            {
                TraceAgent.Write(ex, TraceLevel.Error);
            }

            Console.WriteLine("Look at your Coyote Trace Monitor!");
            Console.ReadKey();
        }
    }
}
Step4: Start Coyote Trace Monitor

Click: File - New - Run 

Step5: Start your application

Your Coyote Trace Monitor should display the exception you have traced: