Speaking at Boise Code Camp March 16, 2013

February 25, 2013

I’m very much looking forward to the 16 March, 2013 Boise Code Camp. Speakers have signed up for some very cool and informative talks.

I’ve signed up for two sessions myself. The abstracts can be viewed here.

  • An Approach to Real World Application Data Caching
  • Using Mole for Debugging Visual Studio 2010 and 2012 Applications

In addition, I’ll release Ocean 3 as part of the associated session source code.

Have a great day,

Just a grain of sand on the worlds beaches.

Mole v 1.3 for Visual Studio 2010 Released

June 20, 2011

Mole 2010 v1.3 contains a lot of enhancements made in response to customer feedback. These range from simple bug fixes to making existing features more powerful.

Developers leveraging Prism will be happy to find enhanced support for exploring objects from the Prism and Unity frameworks.

Several fixes will make our large user base in Germany quite happy, including the ability to use a list separator, other than a comma, in exported CSV files.

Mole v1.3 Enhancements

  • Fixed bug where Mole would not close properly when computer has a touch-enabled screen (worked around a WPF issue).
  • Enabled viewing and drilling into more collection types. Mole 2010 now supports drilling into any IEnumerable object.
  • Both the Key and Value properties of a DictionaryEntry object are now shown in the MoloScope’s Value column.
  • Collection items for NameValueCollection now show the keys and values in the MoloScope.
  • Improved support for working with Prism and Unity applications (support for drilling into the RegionManager and Unity container collections).
  • Enabled drilling into objects with only non-public fields.
  • Exporting collection data to CSV now uses the list separator defined by your system locale, instead of always using a comma.
  • The Options dialog allows you to specify a list separator to use in the CSV files, if necessary.
  • MoloScope column widths are no longer set to incorrect large values when running on a system with the German locale.
  • Snapshot rendering of Windows Forms controls has been modified to properly handle some edge cases.

Current Registered Users

Current registered users of Mole can download this updated version and install the new version over old one.


Demo Version Available

If you are interested in trying out Mole 2010 before buying it, visit the Molosoft Demo page to get the latest release of the trial version. The trial version includes the new features and fixes listed on this page.

Learn About Mole

To learn about the Visual Studio 2010 Debugger Visualizer Mole and how this debugging tool can help you when debugging applications in Visual Studio 2010, please visit Molosoft.com.


We welcome and appreciate your feedback on Mole!

Have a great day,

Just a grain of sand on the worlds beaches.

Extending Mole 2010’s Reach – Mole Type Loader

April 4, 2011

Since the first version of Mole was released in December 2007, the number one support question has been, “I installed Mole but I can’t start it; how do I start Mole?” With the launch of Mole 2010, this has not changed.

When are Types are Listed in a Data Tip?

An important distinction that causes some confusion with visualizers is, “Mole can visualize any type, however not all types are registered with Visual Studio to launch the Mole visualizer.”  In order for Visual Studio to launch a visualizer, the visualizer must be listed in a Data Tip for a type at a break point.

All versions of Mole have been able to visualize any .NET type.  Internally, Mole works with System.Object.  It’s this capability of Mole that allows it to drill around the managed heap, displaying information at debug-time about your application’s types because all types are internally treated equally.

When a debugging sessions begins, Visual Studio reflects all .dll assemblies located in the two well known visualizer folders and builds a cache of types specified in the DebuggerVisualizer attributes that decorate these  assemblies.

The well know visualizer folder locations are:

  • {Visual Studio 2010 install location}\Microsoft Visual Studio 10.0\Common7\Packages\Debugger\Visualizers
  • {User Documents folder}\Visual Studio 2010\Visualizers

Visual Studio uses the type and visualizer specified the DebuggerVisualizer attribute to build a cache of types and the visualizers that can visualizer specified types.  In many cases, registering a base type using the DebuggerVisualizer attribute will cause Visual Studio to associate the base type and all super types, but not in all cases.

The below code snippet shows how the generic List<T> or List(Of T) is registered with Visual Studio, specifying Mole as the visualizer.  This attribute, along with many others decorates the Mole 2010 visualizer assembly.

[assembly: System.Diagnostics.DebuggerVisualizer(
        Target = typeof(System.Collections.Generic.List<>), 
        Description = "Mole 2010")]

When at a breakpoint, hovering over a variable will bring up the Data Tip and any visualizers that have registered for this type will be listed as in the image below.


Selecting the Mole 2010 visualizer will launch Mole pictured below.


As you can see, there is a direct correlation between the types registered in visualizer assemblies and the types that have a visualizer listed in the Data Tip.

Mole 2010 version 1.2 ships with 1801 DebuggerVisualizer attributes decorating the Mole visualizer assembly.  All of the 1801 types registered with Mole 2010 are all .NET Framework types.

So the question is, how can a developer launch Mole for a type that does not have a specified type?

System.WeakReference Wrapper Technique

The below screen shot is taken from the Mole 2010 Read Me page.


Extending Mole 2010’s Reach by Registering Your Types With Visual Studio

Using the above WeakReference technique is a good solution for one-off types you would like to visualize.  But what about types you need to visualize on a daily basis that are not part of the 1801 types pre-registered by Mole?  For example Prism types, Enterprise Library types or types in frameworks that you develop.

I have been thinking about this problem for a while now and did a spike last week to prove that an assembly could register types for another visualizer assembly.

The below image shows the installation location for my copy of Mole 2010 that has the 1801 DebuggerVisualizer attributes.


The below image shows the location of an assembly that has many DebuggerVisualizer attributes that specify types that I want to have a Data Tip for that lists the Mole 2010 visualizer.


The below image shows the Mole Type Loader UI.  This utility program allows developers to select .NET assemblies and have their types used to create the above custom type loader .dll.  From the list on the left, you can see I’ve elected to load up the Prism and Ocean assemblies and have their types registered with Visual Studio. 

The reason the custom type loader .dll file is under the Documents folder instead of the Visual Studio installation folder is because of write permissions.  Users have write permissions under their Documents folder but not under Program Files without changing permissions.  Also, I didn’t want to have the executable in a different folder than the data file.  Of course, you can modify the code to change the location of the data file if you want.


The below code snippet is from the generated custom type loader assembly.

[assembly: System.Diagnostics.DebuggerVisualizer(
    "Mole.EntryPoint, Mole.Visualizer.VS2010, Version=, ...", 
    "Mole.BackEnd.MoleVisualizerObjectSource, Mole.Visualizer.VS2010, Version=, ...", 
    TargetTypeName = "Ocean.DataGeneration.DataGenerator, Ocean", 
    Description = "Mole 2010")]

As you can see in the below image, Visual Studio displays a Data Tip for the Mole 2010 visualizer when hovering over an Ocean DataGenerator variable while at a break point.

This was made possible by the above custom type loader .dll having the assembly decorated with a DebuggerVisualizer attribute that specified the DataGenerator and pointed to the Mole 2010 visualizer.


The Fine Print

Ok, it’s time for the fine print. 

First, although we have tested this utility program, this is an experiential technique for registering additional types (your types) with Visual Studio.  This is not part of the Mole 2010 offering nor is it supported by Molosoft.  If you have a question or issue, please leave a comment on this blog post.

Second, in order for this to work, Mole 2010 and associated assemblies must be installed in the GAC. See Requirements below.

Mole 2010 Type Loader


Provides a utility application that can discover types in an assembly, store those types in a local data tile and then create a custom type loader .dll that contains DebuggerVisualizer attributes for each type that has been loaded.


I recommend that your perform a Release build of the Mole.TypeLoader project and then copy the files to a folder under your Documents folder structure.  This will allow the application to write its data file without a permissions issue.

Next, add the Mole.TypeLoader.exe application to your start menu for quick access.


Important: You can’t have any active debug sessions running when running the Mole.TypeLoader.exe application.  Visual Studio locks the Mole.TypeLoader.exe output file during debugging sessions and you will not be able to create a new one while a debugging sessions is running.

There are four requirements or actions that must be followed otherwise you’ll get unexpected results. 

  • Requires Mole 2010 version 1.2 or later.  See Molosoft news.
  • All Mole 2010 assemblies must be installed into the GAC
  • Each time a new version of Mole 2010 is installed you must:
    • Edit the Mole.TypeLoader.exe.config and update two settings
    • Run Mole.TypeLoader and execute the “Create Mole Types assembly” menu command

While not required by the Mole.TypeLoader application, all Mole 2010 .dll’s must be installed into the GAC so that when the Mole.Visualizer.VS2010.CustomTypeLoader.dll is created and the Mole visualizer is specified as the visualizer for the types, Visual Studio will be able to start the Mole 2010 visualizer.

This requirement is part of the above, “fine print.”  Despite the fact that that the Mole.Visualizer.VS2010.CustomTypeLoader.dll is located in a well known visualizers folder, its DebuggerVisualizer attributes specify an assembly by strong name, but not by the full path name.  Unless the Mole 2010 assemblies are in the GAC, the .NET Framework will not be able to locate and load the assemblies at debug time.  This is why the Mole 2010 assemblies must be installed into the GAC.

To install Mole 2010 assemblies into the GAC:

  • Open a Visual Studio 2010 command prompt, be sure to “Run as administrator”
  • Navigate to the folder where the Mole 2010 assemblies are installed and execute the following commands:
    • gacutil /i Mole.Visualizer.VS2010.dll
    • gacutil /i Microsoft.Licensing.Permutation_0e3eb_2.0.dll
    • gacutil /i Microsoft.Licensing.Runtime2.0.dll
    • gacutil /i Microsoft.Licensing.Utils2.0.dll

To uninstall Mole 2010 assemblies from the GAC:

  • Open a Visual Studio 2010 command prompt, be sure to “Run as administrator”
  • Navigate to the folder where the Mole 2010 assemblies are installed and execute the following commands:
  • gacutil /u Mole.Visualizer.VS2010
  • gacutil /u Microsoft.Licensing.Permutation_0e3eb_2.0
  • gacutil /u Microsoft.Licensing.Runtime2.0
  • gacutil /u Microsoft.Licensing.Utils2.0

Each time you install a new version of Mole 2010, you must update two settings in the Mole.TypeLoader.exe.config file, MoleAssemblyName and MoleObjectSource. 

You must ensure that the Version in the .config file matches the version of Mole 2010 you have installed.  The version can be viewed in the Mole 2010 About dialog, can be obtained by viewing the Mole 2010 visualizer assembly file properties in Windows Explorer, or can be viewed in Reflector.

<setting name="MoleAssemblyName" serializeAs="String">
    <value>Mole.EntryPoint, Mole.Visualizer.VS2010, Version=, Culture=neutral, …
<setting name="MoleObjectSource" serializeAs="String">
    <value>Mole.BackEnd.MoleVisualizerObjectSource, Mole.Visualizer.VS2010, Version=, …

The below Mole 2010 About dialog displays the version of Mole 2010 that is installed.


You can also right click on the Mole 2010 visualizer assembly and view the File version.  This matches the above Mole assembly Version.


If you forget to update the .config file or don’t run the Mole.TypeLoader.exe and create a new Mole Types assembly after updating the .config file, you’ll get an error dialog when you attempt to view a custom type that was loaded by the Mole.TypeLoader utility.

Mole.TypeLoader Command Line Mode

The Mole 2010 Type Loader can be used in two modes; command line or as a normal WPF application.

When used as a command line application the following command line parameter are supported:

  • Mole.TypeLoader /?
    • This will display the command line usage in a console window
  • Mole.TypeLoader {folder to load}
    • This command line will load types from all .dll and .exe files in the specified folder.  This feature is useful when you are developing a custom framework or custom application and you want all types in the framework or application to automatically be available to start Mole 2010.
    • This can easily be accomplished by adding a Post-build event like so:
      • {folder where Mole.TypeLoader.exe is}\Mole.TypeLoader $(TargetDir)
      • The $(TargetDir) is a Visual Studio build event macro that returns the output folder

The Mole Type Loader does not load types so re-running of the Mole.TypeLoader.exe as a post-build event will not cause any problems.

When used in command line mode, the Mole.TypeLoader will inspect each .dll and .exe assembly in the specified folder, load its types, save the data file and then create a new Mole.Visualizer.VS2010.CustomTypeLoader.dll.

If an error occurs during this processing, a MessageBox will display with the error information.  Using a MessageBox as opposed to outputting information to a console window allows a developer to see any problems when the application is being run as a post-build task in Visual Studio.

Mole.TypeLoader WPF Application Mode

When Mole.TypeLoader.exe is executed without any command line arguments the WPF version of the application executes.

If you select an assembly from the left side list box, the data grid will be filtered to only display types from that assembly.

When opened, types in the right side data grid will be sorted by AssemblyName and TypeName.  You can change sorting by clicking or SHIFT clicking on the data grid column headers.

The initial status bar message displays the version information from the .exe.config file so that you know what version of Mole the outputted assembly will be targeting.

You can also click on the hyperlink in the lower right corner to visit the Molosoft.com web site.


To remove one or more types, select the row in the data grid and press the Delete key.  To remove all types from a single assembly, select the assembly name in the left side list box, then select all types in the data grid and press the Delete key.

To add one or more assemblies, use the File menu and select, “Select assemblies to load.”  When the files dialog appears, navigate to the desired folder and select one or more .dll or .exe files to load types from.

To create a new Mole.Visualizer.VS2010.CustomTypeLoader.dll assembly, use the File menu and select, “Create Mole Types assembly.”

If you add or remove types and forget to create the assembly, it will automatically be created for you.


Application Settings in Mole.TypeLoader.exe.config

LastFolder – this saves the last folder that assemblies were load from.  No reason to change this value.

OutputAssemblyName – this is the name of the assembly that will created that contains the DebuggerVisualizer attributes for all loaded types.  No reason to change this value.

OutputFolderName – this is the folder name where the assembly is outputted.  If this setting is blank (the default) the Mole.Visualizer.VS2010.CustomTypeLoader.dll will be outputted to {Documents}\Visual Studio 2010\Visualizers folder. 

If you change this setting to output to the {Visual Studio 2010 install location}\Microsoft Visual Studio 10.0\Common7\Packages\Debugger\Visualizers folder, you must ensure that you set write permissions on the file, otherwise write errors will occur.

MoleAssemblyName – this is the entry point and the Mole 2010 assembly strong name.  This value will need to be updated each time a new version of Mole 2010 is installed.  You should only have to update the Version as described above.

MoleObjectSource – this is the object source and the Mole 2010 assembly strong name. This value will need to be updated each time a new version of Mole 2010 is installed. You should only have to update the Version as described above.

MoleDescription – this is the visualizer name that will appear in the Data Tip. No reason to change this value.

DataStoreFileName – this is the name of the file that the Mole.TypeLoader.exe saves its data to.   No reason to change this value.


Mole Type Loader Source (295KB) can be downloaded from my Sky Drive.


I realize there are a few moving parts to this solution.  However, once set up, its very easy to maintain and easily add and remove types from the custom types assembly that is created.

Feedback welcome.

Have a great day,

Just a grain of sand on the worlds beaches.

Mole 2010 v1.2 Released

April 3, 2011

Molosoft has been hard at work. We incorporated some customer feedback into Mole 2010, added a killer new feature for WPF and Windows Forms developers, and fixed a few minor issues. Read more about it and download the Mole 2010 v1.2 installer here.

Have a great day,

Just a grain of sand on the worlds beaches.

Mole 2010 Demo Released

March 6, 2011

Many developers have asked for a demo version of Mole 2010.  We have just released it at http://www.molosoft.com/demo/.

Sorry it has taken an extra week to release.  I’ve been sick for the last 10 days and have not been able to work or attend the Boise or Dallas Code Camps I really wanted to attend.  I’m hoping I’m out of the woods.

In the mean time, Josh has posted two nice blog posts on using Mole 2010 here:

Have a great day,

Just a grain of sand on the worlds beaches.


Mole 2010 Released

February 22, 2011

Visit Molosoft.com

A few years ago, some friends and I released Mole for Visual Studio 2008. Mole is a debugger visualizer that runs in Visual Studio while you are debugging .NET applications. Our goal was to make debugging easier, which Mole accomplishes because it provides a comprehensive view into all of your application’s data objects. Although the tool was created as a pet project to help us with our own work, it became quite popular, and has been downloaded more than 100,000 times (that we know about).

When Visual Studio 2010 was released, we had to make a decision. Either we could just upgrade the old Mole so that it works in Visual Studio 2010 (which some people have already done), or we could take the plunge and make Mole all that we knew it could be. We decided to take the plunge…

After a year of dedication and hard work, we are thrilled to announce that our new version of Mole is now available! Mole 2010 is the next generation of the Mole debugger visualizer, built to work in Visual Studio 2010. The new version of Mole makes the previous one look like a half-baked prototype.

Mole 2010 has many useful new features, bug fixes, and performance optimizations. Not only is it a more powerful tool, but it also looks much better and is easier to use. We rewrote the entire user interface in WPF, and even brought a professional Visual Designer onto the team to make sure that Mole looks as great as it works.

Our hard work resulted in a useful, powerful, and elegant debugging tool. We are extremely proud of Mole 2010.

We are selling Mole 2010 for $49.99 from our company Web site: www.molosoft.com

If you are a .NET developer using Visual Studio 2010, check it out!

Have a great day,

Just a grain of sand on the worlds beaches.

Karl’ Roadmap Nov – Dec 2010

October 31, 2010

While my blog has been a little on the quiet side, I’ve been going like a rabbit with his tail on fire.  Metaphorically speaking, “What lies beneath the water line of the iceberg is about to be unveiled.”

I’ve been getting emails, Tweets, and blog comments asking me about XAML Power Toys, Ocean, Mole 2010, my upcoming cruise, Prism, In the Box, patterns & practices 2010 Symposium code; so I thought a short roadmap post is in order.

Prism 4

Prism 4 will RTW either this Thursday, 4 November 2010 or early the following week.

The patterns & practices Prism team has invested a lot of resources in the Prism Library and written guidance.  The documentation has been completely rewritten with new topics added such as MVVM, MEF and navigation.

Once released, I’ll blog regularly on the features and content of the Prism guidance.  Additionally, I’m researching the possibility of conducting three Prism events; I’m thinking of using the two day event model, holding the sessions over a Friday and Saturday.  Once the dates and locations are firmed up, I’ll provide plenty of lead time to plan and register.

patterns & practices 2010 Symposium Code

On the day Prism v4 ships, I’ll post the MVVM Training that was package using In the Box.  In the Box is explained below.

This Friday, 5 November 2010 I’ll publish a blog post and video covering the Prism Region Navigation sample application that also demonstrated the Task Parallel Library Futures pattern that streamlines view model code.

XAML Power Toys

I was hoping to get to the next release in November but am putting this work off until early December.  I’ll release a new version with the suggestions and performance fix on 19 December 2010.  If you have a suggestion or requested fix, please leave a comment here.

Mole 2010

Team Mole has put in several hundred hours in this new release.  We have been cautious with our release, wanting to provide the very best product.  Mole 2010 is code complete, has a great new UI and many new features you’ll love.  Team Mole is completing the documentation and videos and hopes to ship very soon.

You can follow Josh Smith’s blog and my blog for the release announcement.

We can also be followed on Twitter:


I’ve already ported Ocean to C#, Windows Phone 7 and released it here.

I’m currently porting Ocean for WPF and Silverlight to C#.

While on my cruise over Thanksgiving, I’ll write a reference implementation that shows Ocean v3 in action.

Expect this to be released on Sunday, 5 December 2010.

Mexican Riviera Cruise

It has been a year and the time has come to set sail again; this time to the Mexican Riviera.  With three full days at sea and each night spent at sea, kdawg will have plenty of coding time!  No email, no phone, no Internet, just heads down coding.  The sounds and scent of the ocean breeze; gentle rolls of the ship and room service grill cheese, sets the stage for a week of creativity and productivity.

I’ve been wanting to update my Stuff application to consume Amazon.com data and to support many more item types.

The core scenario is to be able to look up movies, books, games, music and software I currently own using a phone.  This would allow me to see what I own, if I don’t have it, quickly check the price at Amazon.com and either purchase it at the store (automatically adding to my database) or put the item in my Amazon.com shopping cart.

To accomplish this, I’ll be taking these three patterns & practices assets out for a test drive, Prism, Windows Phone 7 Developer Guidance, and Unity Application Block.  To those, I’ll add Ocean v3 to the supporting cast.

The application will have an oData cloud services component with WPF, Silverlight, Windows Phone 7 and ASP.NET MVC3 front ends.  The cloud services component will be hosted on my Discount ASP.NET site.  Each developer wanting to have their own live service, will need to deploy the backend to their own hosted web server.

Developers will be able to compile and run the application locally on their system.  For Amazon.com access you’ll need a free developer account.  Again, to use the application remotely, you’ll need to host the cloud component on your web server.

What is exciting to me is the notion of a single cloud service consumed by the very cool UI stacks offered by Microsoft .NET.

It will a lot of fun working with the technologies that are new to me, Windows Phone 7 and ASP.NET MVC3.  When coding, I’ll be looking for code-reuse opportunities when writing the WPF and Silverlight applications powered by the above patterns & practices assets.  All-in-all, a very relaxing and fun vacation.

Just so you don’t think I’m insane and never stray from my keyboard, I’ve signed up for a 7 hour dolphin training experience and a day on the jet ski during my cruise.

The 7 hours with Flipper is one of those bucket list goals I can finally check off and is the main reason for visiting the Mexican Riviera.  The day on the jet ski will be one big nasty adrenalin rush.  The other day in port will be spent shopping for some cool shirts, a sombrero and tasting the local cuisine.

Expect this application to be released on Sunday, 5 December 2010.

In the Box


At the patterns  & practices 2010 Symposium and at the post PDC 2010 Windows Phone 7 Lab Day, I previewed, “In the Box” and the first training package, MVVM Training.

So far response to this format and the content has been very favorable.

The training is unique because it’s consumed within Visual Studio 2010.  The interface is pictured below.

To create the content, I followed the training videos presented on Channel9 here.  For more information you can also follow Michael Lehman’s blog.

This will ship from the Visual Studio Code Gallery on the same day Prism v4 ships, either Thursday, 4 Nov or the following week.  My next planned training package for In the Box will be Prism v4.  Remember, every thing comes “In the Box.”


Click the image to view full size

Date Summary

Check my blog or follow me on Twitter for these announcements:

  • 4 Nov – Prism v4 (could possibly ship the following week)
  • 4 Nov – In the Box (could possibly ship the following week)
  • 5 Nov – Prism Region Navigation with Task Parallel Library Futures example  (could possibly ship the following week)
  • 5 Dec – Ocean v3, and the vastly upgrade Stuff application with multiple UI front ends
  • 19 Dec – XAML Power Toys update


WOW – what a way to close down 2010!  Looking to power down after the 19th of December; then crank back up January 2011.

Have a great day,

Just a grain of sand on the worlds beaches.


Get every new post delivered to your Inbox.

Join 255 other followers