System.Diagnostics Tracing and DebugView#

The other day I ran across DebugView by Sysinternals. After playing with it for a few I suddenly had a re-found love for System.Diagnostics.

“DebugView is an application that lets you monitor debug output on your local system, or any computer on the network that you can reach via TCP/IP. It is capable of displaying both kernel-mode and Win32 debug output, so you don’t need a debugger to catch the debug output your applications or device drivers generate, nor do you need to modify your applications or drivers to use non-standard debug output APIs.” from Sysinternals

This means you have a nice little exe you can carry on a thumb drive and collect those trace events at runtime on from any machine. Let’s look at some code.

First define a TraceSwitch. This switch gives you the ability to determine when to throw an event. You can define multiple switches.

public static TraceSwitch GeneralTraceSwitch = new TraceSwitch(”General”, “My Trace Switch”);

if ( GeneralTraceSwitch.TraceError )
  Trace.TraceError( “YOUR ERROR MSG” );

Now let’s setup configuration. There are two major sections, listeners and switches. Listeners define where System.Tracing should send your events. The example below sends events to both the EventLog and a text file. Having said that has no influence on DebugView, you do not have to define a listener for DebugView to pick them up. The switches section defines the level of events to throw. 1 is the minimal number of events, while 4 is everything.


<configuration >
 <system.diagnostics >

  <trace autoflush=”true” indentsize=”0″ >
    <listeners >
      <add name=”EventLogTraceListener” type=”System.Diagnostics.EventLogTraceListener” initializeData=”Team Build”/>
      <add name=”TextWriterTraceListener” type=”System.Diagnostics.TextWriterTraceListener” initializeData=”.\ci.log” />
    </listeners >
  </trace >

  <switches >
    <add name=”General” value=”4″ />
  </switches >
 
 

</system.diagnostics >
</configuration >

Friday, October 21, 2005 10:15:26 AM (Central Daylight Time, UTC-05:00) #    Comments [0]  | 

 

MSTest.exe#

Stumbled across a command line tool ( MSTest ) which executes your VSTS test list. You can call if from a Visual Studio command prompt or @ C:\Program Files\Microsoft Visual Studio 8\Common7\IDE

Upon execution this will create the same output as if you executed your tests inside of Visual Studio.

Thursday, October 20, 2005 10:11:48 AM (Central Daylight Time, UTC-05:00) #    Comments [0]  | 

 

Creating MSN Desktop Search Shortcuts#

Creating MSN Desktop shortcuts is easy. The following is an example which creates a shortcut which will search a particular SharePoint site.

Copy this into the desktop search box…
@someweb,http://someweb/search.aspx?k=$w

Now you can search SomeWeb by typing:
someweb search_string

Thank you to Elizabeth Caley for sharing the tip.

Wednesday, October 19, 2005 10:11:24 AM (Central Daylight Time, UTC-05:00) #    Comments [0]  | 

 

MSN Search#

Looking for a simpler MSN Search interface http://search.msn.com/.

Still not convinced about MSN search, try this site the next time you are searching http://www.addysanto.com/dualsearch.htm

Sunday, October 09, 2005 10:10:57 AM (Central Daylight Time, UTC-05:00) #    Comments [0]  | 

 

VSTSPlugins Launched#
Add this to your toolbox http://vstsplugins.sourceforge.net
Wednesday, October 05, 2005 10:10:34 AM (Central Daylight Time, UTC-05:00) #    Comments [0]  | 

 

Refresh your InfoPath form’s schema#
I recently had an itch to play with InfoPath. I created a simple XSD schema and then started to build a form on top of it. Shortly after I found myself fixing the schema but I couldn’t figure out how to refresh the schema. MSN search pointed me to the answer .
Wednesday, October 05, 2005 10:10:09 AM (Central Daylight Time, UTC-05:00) #    Comments [1]  | 

 

All content © 2010, Clark Sell
On this page
This site
Calendar
<March 2010>
SunMonTueWedThuFriSat
28123456
78910111213
14151617181920
21222324252627
28293031123
45678910
Archives
Sitemap
Blogroll OPML
Disclaimer

Powered by: newtelligence dasBlog 2.3.9074.18820

The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

Send mail to the author(s) E-mail

Theme design by Jelle Druyts


Pick a theme: