# Tuesday, 25 May 2010

Opening up Outlook .pst files

Microsoft has announced two open source solutions for accessing Outlook .pst files. Read the press release here: http://www.microsoft.com/presspass/press/2010/may10/05-24PSTToolsPR.mspx

I’ve been able to find the following on Codeplex:

PSTViewTool : http://pstviewtool.codeplex.com/

PST SDK: http://pstsdk.codeplex.com/  [Thanks to Greg!]

Also, doing a search for Outlook on CodePlex offers a lot of solutions for looking at Outlook data or integrating with Outlook: http://www.codeplex.com/site/search?query=outlook

Update: Added the PST SDK.

#    Comments [4] |
# Monday, 24 May 2010

Silverlight 4 and ICommand

Silverlight 4 offers the opportunity to databind against a command. This is useful in MVVM scenarios. For some reason there is no quick implementation of a command (or I have been unable to locate it) so I wrote my own ‘QuickCommand’:

#region QuickCommand
public delegate void Execute( object parameter );
public delegate bool CanExecute( object parameter );

public class QuickCommand : ICommand

    private Execute _executeMethod;
    private CanExecute _canExecuteMethod;

    public QuickCommand()
        : this( null, null )

    public QuickCommand( Execute executeMethod )
        : this( executeMethod, null )

    public QuickCommand( Execute executeMethod, CanExecute canExecuteMethod )
        _executeMethod = executeMethod;
        _canExecuteMethod = canExecuteMethod;

    #region ICommand Members

    public bool CanExecute( object parameter )
        if ( _canExecuteMethod == null )
            return true;
            return _canExecuteMethod( parameter );

    public event EventHandler CanExecuteChanged;

    public void Execute( object parameter )
        if ( _executeMethod != null )
            _executeMethod( parameter );

#endregion QuickCommand

The Quick command allows you to assign a lambda expression to a ICommand property like this:

public class MainView
    public MainView()
        About = new QuickCommand( c => MessageBox.Show( "© Develop-one, 2010" ) );

    public ICommand About { get; set; }

This ICommand property can then be used for databinding a button control (I removed the default namespace declarations):

<UserControl ... 
<StackPanel Orientation="Vertical">
    <HyperlinkButton Content="About" Name="hyperlinkButton1" HorizontalAlignment="Center" Command="{Binding About}"/>

See how the ‘Command’-property of the button binds against ‘About’-property of the MainView class? Sweet!

#    Comments [0] |
# Monday, 10 May 2010

Accessing TFS 2010 from Visual Studio 2008

I’ve recently installed TFS 2010 and have been running some projects on a complete 2010 oriented environment. Today I found the need to also connect to TFS 2010 from Visual Studio 2008. (essentially due to a project that I cannot convert to 2010, yet). In order to connect to Team Foundation Server from VS2008 you need the Visual Studio Team System 2008 Team Explorer, then in order to connect to TFS 2010 you also need the Visual Studio Team System 2008 Service Pack 1 Forward Compatibility Update for Team Foundation Server 2010.

So my initial setup was:

  • Windows 7 Ultimate 64-bit
  • Visual Studio 2008 Team Suite SP1
  • Visual Studio 2010 Ultimate

I installed Visual Studio 2008 Team Explorer and then on top of that the Forward Compatibility Update. I received no errors during the installations, but I was unable to connect to my TFS 2010 machine. I tried Martin Kulov’s suggestion of entering a full URL. This was not accepted as input. Neil Rees blogged about reinstalling Visual Studio 2008 SP1 after installing Team Explorer 2008. So I did. Then I reran the installer for the Forward Compatibility Update. Initially still no juice, but then when I entered a full URL (http://servername:8080/tfs/collectionname) it all came together and I was able to connect to a specific collection of team projects from within Visual Studio 2008.
Oh, and not unimportant during all this my VS2010 installation was unaffected.

#    Comments [0] |

Error installing SQL Server 2008 R2

I just tried installing SQL Server 2008 R2 in a VirtualPC environment. This caused an error, redownloading the .iso image from MSDN did not help. I Binged it and found Bob Beauchmin had the same problem. Apparently the .iso reader in VirtualPC causes the problem.

More here: http://www.sqlskills.com/BLOGS/BOBB/post/Getting-error-2337-installing-SQL-Server-on-a-VPC.aspx

#    Comments [0] |
# Friday, 07 May 2010

MSDN Roadshow in Maine

Almost manage to miss it in my inbox, but I just signed up for the Maine MSDN Roadshow event! It will be held on May 11th in Augusta, ME with thanks to State of Maine (John rules!) for the accommodations and of course Microsoft for making Chris and Jim drive all the way up north :-)

The Agenda:  A Payload of Awesomeness

“Fore!” – Slicing Into What’s New in Silverlight 4

Silverlight is all about driving your applications into the fairway of user experience.  Silverlight 4 tees up many new features to help you create rich applications that will hook your customers’ interest.  You’ll see Visual Studio 2010’s improved designer, microphone and webcam support, core API and XAML improvements, new out-of-browser options, and more.  Of course, these features aren’t rough to use, and you’ll get into the swing of things in no time.

“Don’t T(h)read on Me” – Snaking Through the New Parallel Programming Options

Many developers recoil at the prospect of writing and debugging multithreaded and multicore applications.  The great news is there’s plenty to help in .NET Framework 4 and Visual Studio 2010.  We’ll sink our teeth into Task Parallel Library, PLINQ, Visual Studio 2010 debugging features, and new Framework classes that offer ways to make efficient programs and help shed those concurrency worries.

“Weaving the Next Web” – ASP.NET 4, Windows Azure, and Beyond

Visual Studio 2010 makes it easier than ever to stitch together masterful applications.   Continue to ply your existing skills with an improved Web Forms experience, or quickly spin up interactive forms-over-data sites with Dynamic Data.  And of course you can hook right into ASP.NET MVC to craft testable and extensible solutions.  It doesn’t end there though, from the fabric of the same development environment, you can swiftly shuttle your applications, Azure-aware, to the cloud.

“It’s Your Call” – Windows Phone 7, Silverlight, and XNA

Windows Phone 7 is dialed in for a holiday 2010 release and developers can answer the call today by leveraging Silverlight or XNA skills to create and extend applications or games to reach to new customers in new ways.  This demo-heavy session will give you the 411 on using Expression Blend 4 and Visual Studio 2010 with the Windows Phone 7 tools.  After seeing what’s new, you won’t want to put this opportunity on hold.

Sign up here.

#    Comments [0] |
# Monday, 29 March 2010

Repairing Outlook 2007 .pst file

I just had a little scare with Outlook. After installing VSTO 2010 beta 2 64bit on my system my Calendar folder was suddenly corrupt. Luckily there is an excellent (free) way of repairing a broken .pst file. It’s just a little hidden. Read this KB article to find out how to do it.

Tip to Microsoft: Why not register this file as an “Repair” option to a .pst file, allowing me to right-click and fix my broken .pst file?

#    Comments [0] |
# Thursday, 25 March 2010

Upload a file using FTPS

I just implemented a little routine to upload a file to an FTP site using SSL. I started looking at purchasing a component to help me out, but it turns out the .NET Framework offers all you need.

public class FtpStatus
    public FtpStatus()
        Succes = true;
    public bool Succes { get; set; }
    public string Message { get; set; }
/// <summary>
/// Upload a file using FTP and SSL.
/// </summary>
/// <param name="host">Full name without the 's', e.g.  ftp://secure.develop-one.com</param>
/// <param name="filename">Filename including server path, e.g.  /Upload/test.txt</param>
/// <param name="file"></param>
public FtpStatus UploadFile( string host, bool useSsl, string username, string password, string filename, byte[] file )
    FtpStatus result = new FtpStatus();
    string target = host + filename;
    FtpWebRequest request = (FtpWebRequest) FtpWebRequest.Create( target );
    request.EnableSsl = useSsl;
    request.KeepAlive = true;
    request.UseBinary = true;
    request.UsePassive = true;
    request.Method = WebRequestMethods.Ftp.UploadFile;
    request.Credentials = new NetworkCredential( username, password );
        using ( Stream stream = request.GetRequestStream() )
            stream.Write( file, 0, file.Length );
    catch ( System.Net.WebException exception )
        result.Succes = false;
        string message = ( (System.Net.FtpWebResponse) ( exception.Response ) ).StatusDescription.Replace( "\r\n", "" );
        if ( message.IndexOf( ":" ) > 0 )
            message = message.Substring( message.IndexOf( ":" ) + 2 );
        result.Message = message;
    return result;
#    Comments [0] |
# Saturday, 13 March 2010

Exploring Facebook API

I’m looking at creating a new website for our ATV club, but we also have a fan page on Facebook… looking to integrate the two… offering some basic info from Facebook onto our site seems easy… now looking to see if and how I can have a list of Facebook events on own site.

The box below shows a Fan Box for our club.

An here is a Page Badge:

Dwinal Pond 4 Seasons Club | Promote Your Page Too

Go to http://developer.facebook.com to create these widgets for your site.

#    Comments [0] |
# Wednesday, 10 March 2010

Reading Excel files in a WCF service using OleDB requires 32bit process

I’ve been doing a little work on a WCF service that reads an Excel file. My development machine is running Windows 7 64bit and my service was deployed to IIS. I kept running into a problem with opening the OleDb connection to the Excel file: “Error: Microsoft.Jet.OLEDB.4.0' provider is not registered on the local machine.”

Turns out that Office Jet provider will only run in 32bit. After changing my ASP.NET processes to run in 32bit everything ran just fine.

This KB article shows how to change ASP.NET to 32bit: http://support.microsoft.com/kb/894435/en-us

#    Comments [2] |
# Tuesday, 09 March 2010

Translating Software Maintainability Metrics into dollars

Nowadays there are a variety of tools and services available that provide insight into the quality of the code. In order to quantify quality a number of metrics are collected and used to create a maintainability index number. Visual Studio Team System gathers metrics to put a number on the quality of your code. While Omnext offers code is a company which offers services around providing insight into the functioning, quality, and size of software. Now what to do once you have a number? What does it really mean, other than wanting to be good and not score low on a report?

I offer a basic solution:

A project which scores high on maintainability can be maintained by junior to medior skilled developers.
A project that scores low requires senior developers to maintain the application and effectively do what a junior could do on a better code base.

This leads to a simple mathematical deduction.

A senior developer costs 30% to 40% more than a junior. Therefore a bad system will cost 30% to 40% more to maintain than a good system. Of course the increase is not quite linear so if we put it on a sliding scale/table we get:

Maintainability Index

Increase in maintenance cost


























Feel free to refer to this as the Blomsma Code Metrics Cost Factor.

#    Comments [0] |
# Monday, 01 March 2010

SQL Azure Backup

Last week at the BAND user group meeting in Bangor me and Chris Bowen had a little unresolved discussion about how SQL Azure manages backups. Today I found (thanks to Ben Rees) a segment of a presentation that was done at PDC’09 by Dave Campbell and Tony Petrossian. I grabbed the screen that covers what is and what will be available when it comes to backup.


1. Automatic failover. Every SQL Server instance will be configured for automatic failover. This is part of the standard service, no additional charge.
2. BCP, SSIS or other custom tools. Today (3/1/2010) there is only one way to create backups and that is pull the data to a local backup. You end up paying for bandwidth usage.
3. Database clone. A on demand backup which creates an (almost) instant replica of your database. Useful before doing schema changes and you could easily schedule the creation of a daily clone if you wish to do so. You pay for the storage. This feature should become available 1H 2010.
4. Continuous Backup. Backups run as specified by user where you will be able to restore the database to a specific point in time. Pricing not available yet. This feature should become available 2H 2010.

Update: Original video is here.

#    Comments [0] |
# Thursday, 11 February 2010

Visual Studio & MSDN availability on Amazon

VS2010 is not yet available on Amazon.com, but VS2008 with MSDN subscription is. If you purchase VS2008 with a MSDN subscription today then you will still qualify for a free upgrade to VS2010 when it goes RTM.


More info on the offer here: http://www.microsoft.com/visualstudio/en-us/howtobuy/ultimate-offer.mspx

#    Comments [0] |

VS2010 & TFS2010 Licensing Whitepaper

Now that the Release Candidate is available and RTM is scheduled for April 12th it will be time to see how you can get licenses for these great tools.
Read the Licensing Whitepaper to find out what you need: http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=2b1504e6-0bf1-46da-be0e-85cc792c6b9d

#    Comments [0] |
# Tuesday, 09 February 2010

Using Windows 7 Search to delete ‘obj’ folders

Visual Studio will create ‘obj’ folders within your solution to store a bunch of temporary files. You can remove these files in a number of ways.
One easy way is to use Windows 7 Search to look for all the ‘obj’ folders and just delete them manually.
To do this I use the ‘kind’ keyword in the query box.


Tip: Just typing ‘kind:’ will give you a list of choices to choose from.

For a complete overview of the Windows 7 Search syntax go to: http://www.microsoft.com/windows/products/winfamily/desktopsearch/technicalresources/advquery.mspx

#    Comments [0] |
# Monday, 08 February 2010

Visual Studio 2010 RC and Team Foundation Server 2010 RC available

Both Visual Studio 2010 RC as well a Team Foundation Server 2010 RC are available to MSDN Subscribers as of today.
Go to: http://msdn.microsoft.com/en-us/subscriptions/downloads/default.aspx

If you want to provide feedback on this release then you do so by using Microsoft Connect.
Go to: https://connect.microsoft.com/VisualStudio

For any additional information about versions of Visual Studio 2010 and .NET Framework 4,
Go to: Visual Studio 2010 and .NET Framework 4 Release Candidate

#    Comments [0] |
# Tuesday, 02 February 2010

MDN - Augusta Developer Event, 24th of February 2010

Time for the first Augusta Developer Event of 2010. Join us for a morning filled with information about Silverlight. Shawn, Chris and Mark will present a variety of topics and we've planned a group discussion, so make sure you come prepared with questions, examples and your experiences.

February 24th, 2010 at 9:00am.

What is Silverlight?
Shawn Robichaud – 15 min
Introduction to Silverlight for decision makers, architects and developers.

Choosing the right technology
Mark Blomsma - 30 min
Silverlight vs. WFP vs. Windows Forms vs. ASP.NET. A session for decision makers, architects and developers. Which technology to use for which scenario?

Choosing the right technology – group discussion
Everyone - 30 min
Silverlight vs. WFP vs. Windows Forms vs. ASP.NET. A session for decision makers, architects and developers. Which technology would YOU use for which scenario? Please come prepared with questions, examples and ready to share your experiences.

Silverlight and Section 508 compliance
Mark Blomsma – 30 min
“Section 508 requires that all Web site content be equally accessible to people with disabilities. This applies to Web applications, Web pages and all attached files. It applies to intranet as well as public-facing Web pages.” (http://usability.gov).

Silverlight architecture overview
Chris Bowen – 30 min
Introduction to XAML, Silverlight assemblies, n-tier development, asynchronous behavior, …

Silverlight + Windows Communication Foundation overview
Chris Bowen - 30 min
Introduction to WCF based on a Silverlight demo.

Silverlight + RIA Service overview
Chris Bowen - 30 min
Introduction to RIA Services based on a Silverlight demo.

Wrap up
15 minutes.


The event will be held at:
State of Maine Offices
Harlow Building
First floor conference room
18 Elkins Ave

Please register so we can make sure we have sufficient room.
Register here: http://www.maine-devnet.org/Home/SignUpForEvent.aspx.

#    Comments [0] |
# Tuesday, 12 January 2010

Kindle DX

Amazon is finally offering a Kindle which will also download books when you’re overseas. Not sure if they’re hitting the sweet spot when it comes to pricing. I think I’ll wait for the various slates (slim tablet PC’s) that are becoming available this year.

My suggestion for Apple and HP: put a WhisperNet Mobile card in your slate that will allow free access to just your AppStore!

#    Comments [0] |
# Friday, 01 January 2010

MVP 2010

Whoah! Just received an email from PJ:

“We are pleased to present you with the 2010 Microsoft® MVP Award! This award is given to exceptional technical community leaders who actively share their high quality, real world expertise with others. We appreciate your outstanding contributions in Visual C# technical communities during the past year.”

I’ve once again been honored with the Microsoft Most Valuable Professional Award. This is the seventh year running that I’ve been lucky enough to receive this great award and I it’s great to be part of the group of people that receive this award.

#    Comments [1] |