Tuesday, September 2, 2014

Internet Explorer 11 debugging gotchas

If you are using Internet Explorer 11 for software development, you will probably encountered the following two gotchas when debugging locally:

Friday, August 8, 2014

Setup TraceSource logging in a console application

Quick setup for getting tracing an XML file that can be loaded in Microsoft Service Trace Viewer

Create a console application in Visual Studio

Create a TraceSource in your application

namespace TraceDemoApp
    class Program
        static void Main(string[] args)
            var traceSource = new TraceSource("TraceDemoApp");

            // TODO: write to the above TraceSource


Write to said TraceSource

namespace TraceDemoApp
    class Program
        static void Main(string[] args)
            var traceSource = new TraceSource("TraceDemoApp");

            traceSource.TraceEvent(TraceEventType.Verbose, 0, "This is a verbose message");
            traceSource.TraceEvent(TraceEventType.Information, 0, "This is an informational message");
            traceSource.TraceEvent(TraceEventType.Warning, 0, "This is a warning message");
            traceSource.TraceEvent(TraceEventType.Error, 0, "This is an error message");
            traceSource.TraceEvent(TraceEventType.Critical, 0, "This is a critical message");

            // Flush the trace source (if autoflush is not enabled) to ensure that data is written


Configure trace source in application configuration file

<?xml version="1.0" encoding="utf-8" ?>
        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
      <!-- Turn on all traces for the TraceDemoApp trace source -->
      <source name="TraceDemoApp" switchValue="All">
          <add name="console"/>
          <add name="xmlListener"/>
          <!-- Optionally remove the default trace listener -->
          <!--<remove name="Default"/>-->
      <!-- Log traces to XML file that can be opened with Microsoft Service Trace Viewer -->
      <add name="xmlListener"
      <!-- Log traces to console -->
      <add name="console"

Run application and examine output in console and Microsoft Service Trace Viewer

Console Output
Microsoft Service Trace Viewer


No output

Verify that the trace source has a listener that is not the DefaultTraceListener
Only the DefaultTraceListener is listening to the trace source
The default trace listener uses Win32's OuputDebugString method, which will only log to an attached debugger or DebugView.

Wednesday, December 19, 2012

LED Sign TFS Changeset Ticker

A while back, I built a real-time TFS Changeset Ticker that uses the Dream Cheeky LED sign for output.  It displays each user followed by a spark-line like graph of the number of changesets each individual has created over the past 21 days.

Source is at: https://github.com/rpwjanzen/blinken  under the TfsConsoleApplication project.