Tuesday, September 07, 2010

Enjoying my iPhone

I have known for a long while now that there were significant deficiencies in the Windows Mobile approach to smart devices. This had been made clear from Apples paradigm shifting release of the iPhone. However, the fact that I could develop applications for my windows mobile device using tools I was familiar with, kept me holding firmly to the inferior device, until about a month ago, when frustrations with my HTC touch HD (WM 6.1) reached a critical mass, and it happened to coincide with a colleague of mine upgrading to iPhone 4 and selling his old (almost unused) iPhone 3GS at a very reasonable price.
Since then, I have to say I have really been enjoying my iPhone, although, fear not dear reader, I am not about to become yet another Mac fanboi... At least not that easily.
There are some really nice things about the iPhone, but at the same time, some things that could be improved.
The Good
The focus on user experience is really where the iPhone (and indeed apple) really shine. It is quite obvious that this is a device designed to be used while traveling on a train with one hand full of groceries, and you texting arm wrapped around a grab rail for support. The different context sensitive keyboards, the size of the keyboards, the auto-word prompt when you mistype a word, the ability for applications to switch orientation all add up to a great user experience when inputting and reading text, as is evident from the fact that I can type up this whole blog post using my iPhone. The concentration on more natural user interfaces is very welcome.
The hardware is fast becoming the minimum spec for smart phone manufacturers that want to compete on the modern market, which I think signifies that apple really nailed it.
The proliferation of iPhone apps has seen the platform become an instant hit, and overall, I am extremely happy with it, to the point where I will not be going back to a windows mobile 6.* device. The overall consistency of "most" applications in the app store, and the new device friendly controls that apple have encouraged developers to use are on the whole really good, however, that could become a double edged sword.
The bad
Battery life sucks. Also coming from a palm is background, I do miss graffiti as a form of input, but I guess there were so few people that bothered to learn it that I'm probably on the minority here. The 20MB download limit when not on a wifi network I see as an affront to my free market rights to purchase the bandwidth I want and how I want it delivered.

I will be getting a Windows Phone 7 device when they come out, because I really want to get into the WP7 development space. I'll have to wait and see how well then WP7 performs
Before I make a choice as to which device I want to use on a day to day basis... May the best phone win.

Sunday, March 07, 2010

You know your system is in trouble when…

Tried to use my favourite short cut this morning (Windows Key + E), and I got this.


Saturday, March 06, 2010

Speaking at Victoria.Net SIG

Just a quick note to let everyone know that I will be talking at the Victoria .Net SIG on the Microsoft Sync Framework this coming Tuesday http://www.victoriadotnet.com.au/vic-victorianet-dev-sig-formed/vic-victorianet-dev-sig-events.aspx

Hope to see you there.

Saturday, January 30, 2010

More bad luck

As my attempts to learn Sync Framework continue, I find even more issues along the way, this time with the SQLCE runtime. The basic scenario boils down to attempting to fill a Detail view from a dataset linked to a SQL Compact Edition datasource. When the application is run, an error message to the effect of

Unable to load DLL 'sqlceme35.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E).

is displayed, and the application crashes. After trying many different things to solve the problem, a simple google search on the exact error yields the solution. Basically it is a problem on Vista and Win7 x64 environments, and simply requires you to install SQl Compact Edition SP1 found here http://www.microsoft.com/downloads/details.aspx?FamilyId=DC614AEE-7E1C-4881-9C32-3A6CE53384D9&displaylang=en#filelist.

I guess I was just surprised that it was not included as part of Visual Studio 2008 SP1.

A colleague of mine Mitch Denny has told me that “If I was going to pick a person to clear a minefield you would be that person”, I replied that I was hoping it meant he believed I had special unique skills for finding and defusing mines, and not just that I am expendable.

Wednesday, January 27, 2010

TFS 2010 Console Application and the .Net 4.0 Client Profile

One little frustration that has caught me twice now (and so it’s time to blog it so I remember it), is that when you create a Console Application and then start adding references to any of the TFS API libraries to it (such as Microsoft.TeamFoundation.Client.dll), if yoiu just accept all the defaults for a Console Application in Visual Studio 2010 Beta 2, you get this warning

Warning    1    The referenced assembly "Microsoft.TeamFoundation.Client, Version=, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" could not be resolved because it has a dependency on "System.Web, Version=, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" which is not in the currently targeted framework ".NETFramework,Version=v4.0,Profile=Client".    BasicEventListener


and the application will not compile.

The issue is the .Net 4.0 Client Profile does not contain the reference to System.Web, which is required by the TFS API. This is simple to fix, just go to the Properties of your project, and for the Target Framework, select “.Net Framework 4” instead of the “.Net Framework 4 Client Profile”.

The unluckiest developer alive

Sometimes I think I should be a tester for developer tools. For some reason I have the uncanny knack of stumbling onto the most obscure bugs in Visual Studio.

I am currently trying to learn Microsoft Sync Framework, and decided (after watching a good video on how to do it) to set up an ADO.Net Sync Services Local Database Cache. I went through the process step by step, the only 2 differences between my environment and the one demonstrated in the video was that I was running SQL Server 2008, and I was using the AdventureWorks2008 database.

The procedure I followed was this…

  1. Create a new Winforms Application
  2. Add A new Local Database Cache (this starts the wizard)
  3. select the AdventureWorks database
  4. Select the Production.Products, Production.ProductDescription, Production.ProductPhoto tables to add to the cache.
  5. Click OK.

Everything else I left as the default configuration. The result:

Data Synchronization Settings: Incorrect syntax near '.'.

So I figure it’s something to do with my environment. I spent about half an hour Googling and looking at forums before I decided that I must be the first person ever to hit this bug. Next I tried to see if it was because of something in my environment, I checked my setup

Windows 7 64 bit; SQL Server 2008 SP1; Visual Studio 2008 SP1; Sync Framework 2.0 x64;

The only thing I could think might be an issue was the Sync Framework 2.0 x64, so I uninstalled and installed the x86 version. Still the same problem.

I then opened SQL Profiler and tried to see if anything was obvious there, but concluded that it was all OK (I later discovered that I didn’t look closely enough at this).

I then cracked open the wizard dlls in reflector to see if there was any help there, but alas, theat was pretty much a dead end too.

I even posted an article on the Sync Framework Forum.

Frustrated, I decided that it had to be my own environment that was causing the problem, so I set about creating a virtual environment on GoGrid. Once I had managed to get everything installed, I tried just the Production.Products table this time, and got the exact same error.

I then tried creating a completely new table in a completely new database, and, surprise surprise, it actually worked… well, almost. It got past the wizard, but the code it generated would not compile. It appears that I stumbled on yet another bug in the Sync Framework wizard, if you use a table called “SyncTable”, the generated code is broken.

Encouraged by the “success”, I pressed on undeterred. I finally got everything working by creating a table called “MyTable”.

Not satisfied that I had made it work (finally), I decided to try and track down the bug. After about an hour or so of playing around and not having any success, I finally cracked open SQL Profiler again and found that the last statement executed before it died when trying to create a local database cache for the Production.Product table was the following

SELECT * FROM [Product]ion.[Product]

Obviously the code that works out the schema and table name needs some reworking.

Saturday, January 09, 2010

Using the TFS 2010 SDK (Beta 2)

With significant changes to the way TFS 2010 works, especially in relation to Team Build and the new concept of Projects Collections, the API has necessarily adapted to account for these changes. For developers wanting to use these new API’s, there is currently very little in the way of documentation. The TFS SDK code gallery site has a small amount of examples, as well as the beginnings of the API documentation, which although sparse, because of reasonably clear naming conventions actually offers users some guidance when attempting to write integration software for TFS 2010. There are also a few other bloggers around who have some posted code examples.

I have been looking at re-writing TFS Dependency Replicator for TFS 2010, and in so doing have created a very simple application to enumerate some of the objects I am interested in.

In the interests of helping other developers, here is my source code. You can also download the full solution from here.

To run it, you must have .Net 4.0 beta 2 and TFS 2010 Explorer Beta 2 installed on your machine.

class Program
static void Main(string[] args)

// Get a list of all registered Project Collections
Console.WriteLine("Project Collections");
var collections = RegisteredInstances.GetProjectCollections();

foreach (var collection in collections)
Console.WriteLine("Connecting to TFS Server {0} at {1}", collection.Name, collection.Uri.ToString());

// connect to tfs
using (var tfs = new TeamFoundationServer(collection.Uri))
Console.WriteLine("Successfully connected to {0}", tfs.Uri.ToString());

// Get items of interest from TFS


private static void EnumerateServer(TeamFoundationServer tfs)
// Get all of the Team Projects
var structureService = tfs.GetService();
var teamProjects = structureService.ListAllProjects();

Console.WriteLine("Team Projects");

foreach (var teamProject in teamProjects)
Console.WriteLine("\tName: {0}", teamProject.Name);

// extract all the work items
// NOTE: this uses wiql to query the work item store
Console.WriteLine("Work Items");
var workItemStore = tfs.GetService();
var workItems = workItemStore.Query(
"SELECT [ID], [Title] FROM WorkItems");

foreach (WorkItem workItem in workItems)
Console.WriteLine("\tID: {0}\tTitle: {1}", workItem.Id, workItem.Title);

// Get the build servers
Console.WriteLine("Build Servers");
var buildServer = tfs.GetService();
var buildControllers = buildServer.QueryBuildControllers(true);

// Get all the build controllerrs
foreach (var buildController in buildControllers)
Console.WriteLine("\tController: {0}", buildController.Name);

// Get all the build agents
foreach (var agent in buildController.Agents)
Console.WriteLine("\t\tAgent: {0}, Team Project: {1}", agent.Name, agent.TeamProject);

foreach (var teamProject in teamProjects)
// Get each build definition for this Team Project
var buildDefinitions = buildServer.QueryBuildDefinitions(teamProject.Name);

foreach (var buildDefinition in buildDefinitions)
Console.WriteLine("\tBuild: {0}", buildDefinition.Name);

// Get all build Details for this build definition
var buildDetails = buildDefinition.QueryBuilds();

foreach (var buildDetail in buildDetails)
Console.WriteLine("\t\tBuild Number: {0} Build Status: {1}", buildDetail.BuildNumber, buildDetail.Status);