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]  | 

 

Using the Samsung I730 as a Modem#

On your phone enter **7284. This is a short cut that takes you to the Data Connection screen which offers three options:

  • As the modem through USB
  • As the modem through Bluetooth
  • Internal Data Call

    Select the first choice and your PC will now recognize it as a modem. ** NOTE ** Every time you change your battery this reset to its default ( Internal Data Call ).

    Next install the drivers and create a new dial up modem network connection. Get the latest Samsung CDMA drivers at the Samsung Drivers Page. Use the same dial up settings your phone is using.

  • Sunday, September 11, 2005 10:09:40 AM (Central Daylight Time, UTC-05:00) #    Comments [0]  | 

     

    Service-Oriented Architecture : Concepts, Technology, and Design | The Book#

    First let me say this book is very well written. Throughout my career I have read a large number of books, publications and whitepapers and nothing has read as well as this. The content is very well organized and the material is illustrated in such a way where it can be read by all levels of technical staff. Anyone who has any SOA involvement be it development to management should read this book before doing anything. The use of case studies really relates the entire book to ones own organization where they can start to compare and contrast either how they have implemented SOA or might like to. As I was reviewing this book I in fact started to re-architect SOA systems I was building.

    More information can be found at ServiceOriented.ws

    Add it to your library from either Amazon or bookpool. ISBN 0131858580

    I would like to send a personal thank you to Thomas Erl for the opportunity to participate as a technical reviewer.

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

     

    Congratulations, you've installed DasBlog!#

    Be sure to visit all the options under "Configuration" in the Admin Menu Bar above. There are 16 themes to choose from, and you can also create your own.

     

    Wednesday, July 20, 2005 2:00:00 AM (Central Daylight Time, UTC-05:00) #    Comments [0]  | 

     

    Team Test Attributes#

    A quick breakdown of the Team Test attributes compared to NUnit attributes with a few examples.

    All Team Test attributes are found in the following namespace:
    Microsoft.VisualStudio.QualityTools.UnitTesting.Framework

    Attribute Quick List

    Team Test NUnit
    TestClass TestFixture
    AssemblyInitialize N/A
    AssemblyCleanup N/A
    ClassInitialize TestFixtureSetUp
    ClassCleanup TestFixtureTearDown
    TestInitialize SetUp
    TestCleanup TearDown
    TestMethod Test

    AssemblyInitalize and AssemblyCleanup are new. There are no equivalent attributes in NUnit. These attributes run at AppDomain load and dispose.

    [ AssemblyInitialize ]
    public static void AssemblyInitialize()
    { }


    [ AssemblyCleanup ]
    public static void AssemblyCleanup()
    { }

    Acting just like the NUnit TestFixtureSetUp and TestFixtureTearDown with the only one minor difference. Both methods have to be static and the ClassInitialize takes in one parameter. ClassInitialize will execute before any TestInitialize and TestMethod after the AssemblyInitialize while ClassCleanup executes after the TestMethod and TestCleanup but before the AssemblyCleanup.

    [ ClassInitialize ]
    public static void ClassInitialize(TestContext t)
    { }


    [ ClassCleanup ]
    public static void ClassCleanup()
    { }

    TestInitialize executes before each test and TestCleanup executes after each test for every TestMethod.

    [ TestInitialize ]
    public void TestInitalize()
    { }


    [ TestCleanup ]
    public void TestCleanup()
    { }


     

    Tuesday, July 05, 2005 10:05:35 AM (Central Daylight Time, UTC-05:00) #    Comments [0]  | 

     

    All content © 2010, Clark Sell
    On this page
    This site
    Calendar
    <October 2005>
    SunMonTueWedThuFriSat
    2526272829301
    2345678
    9101112131415
    16171819202122
    23242526272829
    303112345
    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: