Nick's .NET Travels

Continually looking for the yellow brick road so I can catch me a wizard....

.NET CF Type Load Exception

I received confirmation this morning that an exception I was getting in the application we are building was not a result of our achitecture, but rather a bug in the .NET CF type loader.  Get this though - in order to recreate the exception you have to write some pretty obscure:

Assembly A:

class Foo {}

class Bar<T> {

    T field;


Assembly B:

struct MyValueType{} //has to be user-defined valuetype i.e. struct, enum...

class Child : Foo {}

class MyClass {

    Child c;

    Bar<MyValueType> b;


".NetCF will fail to load MyClass if MyValueType hasn't been preloaded. The workaround is to pre-load the valuetype  (i..e. use it somewhere in the code before MyClass is first referenced).

The problem exists in the .NetCF v2 SP1. We fixed it for the next version of the .NetCF, the fix may also be rolled into next service release of .NetCF v2."  [taken from an email from Roman Batourkov]

Why AJAX is painful?

For those who have spent any time with me you will know that I'm fairly passionate about two subjects - VB.NET and building Occasionally Connected applications (ie applications for desktop or mobile devices that don't require a connetion 100% of the time).  I was catching up on a few of the older ARCast shows and came across an interview with Israel Kehat that talks about streaming/editting video using AJAX (show is entitled "ARCast – The Adventures of Israel Kehat and Friends in the Strange Land of Streaming Video and AJAX clients"). In this interview they talk about how AJAX has been used to provide a rich user experience coupled with the zero cost of deployment. 

While I agree with a lot of the discussion the point I want to focus on is about debugging.  Ron asks the question about whether debugging Javascript has got any better.  The short answer was No, but Israel then goes on to claim that modern debuggers haven't really improved when it comes to debugging distributed, multi-threaded applications.  This to me sounds like Israel has falled under the web developers delusion that building web applications using a mix of javascript and .NET is easy???  Debugging multi-threaded, distributed windows applications is now infinitely easier using VS2005 than it was with earlier versions of Visual Studio.  For example you can access all the currently running threads, pause threads and even continue to debug your system across network and application bounds - All without leaving VS!

What kind of a sadistic world are we living in that we have to write sophisticated applications in javascript anyway.  It reminds me of all those people who claim that VB.NET is for "soft" programmers who don't understand OO and don't want a strongly-typed programming language.  And what is worse, the dependency on javascript is getting worse.

Ok, to finish on a positive note.  I must admit when Tatham Oddie delivered his Atlas session to the Wellington .NET User Group I was pretty impressed with the level of integration with ASP.NET. 

Go mobile with WCF

On the way to work this morning I was listening to an ARCast show hosted by Ron Jacobs who was interviewing Marc Mercuri about WF, WCF and Cardspace.  This session doesn't really talk about anything revolutionary, but it does highlight some of the features available in both the .NET v2 & v3 frameworks.  In particular they talk about the consumption of Windows Communication Foundation (WCF) by .NET Compact Framework applications.  Since v1 the .NET CF has been able to consume web services.  This means that by exposing a WCF service using the basic profile it can be consumed by a mobile application.

This raises an interesting point about working with WCF when building occasionally connected applications.  The spin from Microsoft focuses on the developer specifying the "C" (ie Contract) of WCF, leaving the "A" & "B" (ie Address and Binding) to be configured on deployment.  This approach is great, but the developer needs to consider network performance and availability in determining which binding should be used. This comes back to building applications where the user doesn't care if it's on or offline. 

LeadTek WinFast USB II Deluxe != MCE Compatibility

Over the last couple of days I have been experiencing Consumer Electronics Anachy where I can't seem to get anything purchased to work properly.  First there was a case of user error where I purchase the Belkin Universal Microphone Adapter for my iPod, only to discover the new video iPods are not supported.  Thankfully Dick Smith Electronics here in NZ were very understanding and refunded the money with no questions asked - VERY IMPRESSED!!!

My next purchase was the LeadTek WinFast USB II Deluxe which I purchased online from Ascent.  By the way, Ascent rock when it comes to purchasing electronics online.  If you order before midday the goods normally arrive early the following day.  All excited that I would be able to use this device to enable TV and Radio through Media Center I rushed home, pulled everything out of the box and put all the pieces together.

At this point I was running the Pre-RC1 version of Vista (Build 5536), which I had only installed last friday.  Vista immediately noticed that a device had been plugged in and prompted to install drivers.  Following the instructions (not wanting to be blamed for not RTFM) I installed the drivers and software that was packaged with the device.  Everything seemed to be going as planned. 

After the requested reboot at the end of the installation process (I thought that reboot were supposed to be a thing of the past since WinXP - why do we still need to do this in Vista??) I went to run the software.  Again I followed the instructions to configure the device to lock to NZ channels.  The channels came up clearly, but alas no sound.  I tried a few things, but figured it was probably an incompatibility with Vista.  I also ran up Media Center only to discover that it couldn't see either the radio or tv tuner.

I decided that I wouldn't reject the device as it might well have been an issue running on Vista.  So, 2 hours later I had a fresh installation of WinXP Media Center (I had forgotten how painful that is to do).  I again went through the installation process of the drivers and software.  This time I had a clear picture AND sounds.  Unfortunately that was the end of my luck - Media Center was still not able to see the radio or tv tuner. 

A few hours later (midnight) I gave up, packed up the box and this morning sent it back to Ascent.  Tomorrow I should get a Hauppauge WinTV-PCR tuner which will hopefully (given the "Plug and play TV tuner suppport for Windows XP Media Center Edition" they claim) work with Media Center.

Oh, and if you read my previous blog post you will realise I have no just installed the RC1 version of Vista - looking forward to tomorrow ;-)

Vista'ized again

Thanks to a proactive Craig Pringle, who came to my rescue with a copy of Vista RC1 (so that I didn't have to download it on my incredibly SLOW Woosh connection), I am now back running Vista.  Actually my setup is a little backwards as I have a desktop machine running Win2K3 R2, while my laptop is running Vista.  Why is this backwards, well one of the reasons I wanted to be running Vista is to use the new ultra slick version of Windows Media Center that is built into the Ultimate version of Vista. 

Over the last day and a bit I have installed both WinXP and Vista on my IBM ThinkPad T43.  The Vista installation was infinitely less painful.  Even the drivers (with the exception of the IBM display driver) installed ok in compatibility mode.  So two hours later I am playing music and displaying my photo album on my living room TV - very cool.

ASP.NET Services

This evening I decided that I would venture outside and go and see a movie. Having not judged the distance to the cinema very well I arrived a good twenty minutes early, which meant that I could watch the first part of an video podcast. The show was talking about reusing the services via atlas. It shows how you can wrap the services in a webservice that can be called asychronously by an atlas enabled page. Interestingly, this is the same process you go through if you want to reuse these services in an occasionally connect application.

So I guess the question is why these services aren't exposed by default? The short answer is probably that there wasnt demand for it. That said, it would be an interesting project for someone in the community to do - build a set of services that can be dropped onto a site in order to expose the services for that site. This of course would have to be accompanied with a client side class library that can be configured to reference the services by url. It should also be configured to cache information locally and make update calls asynchronously using the disconnected webservice agent.

The other question is why the services are relevant to a windows application:

Authentication/Roles - Absolutely, after all we need to know what functionality a user can access, assuming they are able to login. Of course, like a domain computer the app would need to be connected when a user first signs into the app. There after their credentials/roles can be cached.

Profile - Especially in light of WPF, where we can use styles to change the appearance of an application the users profile becomes important. Simple things, like where windows are docked and which toolbars are visible, can be included in the profile. Unlike settings which, unless you code your own settings provider, are saved locally, profiles can be centrally managed.

Windows Live Writer

I was doing a bit of a search for blogging software.  When I was running Office 2007 Beta 2 I attempted to use the inbuild blogging ability, but there was no support for Community Server.  Anyhow, in my search I came across Windows Live Writer which is currently in Beta.  Although I couldn't easily see if Community Server was supported it did seem to have a number of community plugins for services such as Flickr, so I figured I'd give it a go. 

On first launch a useful wizard pops up and walks you through configuring the editor to your blog.  And yes, Community Server is supported.  As such, this is my first blog entry using it.  Let's see how it looks!

Other features include being able to save a local draft, toggle to a web preview and even post a draft to the blog itself.  Would highly recommend you give it a go.

The Microsoft Developer Show

Although not officially confirmed yet (ie the signed documents haven't reach Cameron yet) I have signed up to be the new host of The Microsoft Developer Show.  Look out for some new shows to hit The Podcast Network in the coming weeks.  I have pretty big shows to fill with Dr Pete stepping down due to work and family commitments, but I have already received a number of people volunteering to help out with some of my planned shows.  Stay tuned for more information! 

Sandcastles in the sky

Long live NDoc! Actually, on second thoughts let build another product to do it even better, but this time lets not have a user interface.  This is what Microsoft has done with project Sandcastle.  I guess there will eventually be a user interface for those of us who have grown out of writing code at the command line.  Come on Microsoft, we can do better than this.

Redefining what it means to be mobile

Anyone who attended TechEd Australia will know that Microsoft were reselling the Dell computers that were used to power CommNet and the Hands-On-Labs.  There were two machines on offer, the following being the higher powered machine:

Dell Optiplex Gx620 Desktop Computer
2 GB of RAM
160GB Hard disk
Intel Pentium 2.8Ghz Dual Core Processor
128Mb of dedicated video ATI Radeon X600 Graphics PCI-Express x16
DVD Drive
17” Flat panel display
1 Year next business day on-site warranty
Windows XP Professional SP2 $1349 (inc GST)









So why am I blogging about this after the event has finished?  Well I though readers would have a laugh to know that I went ahead an purchased one of these machines.  Which left me with the problem of how to get the machine home to NZ.  Sending it by courier was going to cost $250, which I thought was a bit extreme.  The alternative was to take it on the plane as Check-In luggage.  A quick hunt at the local markets, and $30, I was equipped with a massive suitcase, large enough to transport a large child. The following photos on Flickr illustrate the future of mobile computing.  Thats right a PC-In-A-Box ;-)

Photo #1 - Dell goes Mobile!

Photo #2 - Dell on the move

Put me on that Podcast

One of the highlights of this year's TechEd was catching up with ARCast host Ron Jacobs for a chat on mobile development.  Unfortunately this podcast is yet to make the airwaves (I'll make another post when it does).  However, I also had a chat with Hugo Ortega of TegaTech who has just published take 2 on his blog.  Make sure you check out the UMPC devices we were discussing.

Show us your colours!!!

On Monday TechEd New Zealand kicked off with over 2000 people registered and over 70 presenters delivering both developer and IT pro sessions.  Unfortunately I was unable to attend the keynote.  Instead I took my time in getting setup in preparation for my first session.  Despite doing an entire dry run of my presentation I still ran into an issue with my first demo – I clearly didn’t prey to Redmond and the demo gods ;-)


With my involvement in TechEd NZ over (slides and demo code will be available on this site towards the end of this week), I’m now sitting in Andrew’s session on VSTO at TechEd Oz.  This is particular relevant in light of the Outlook integration we are doing with the Intilecta application we are building.  Despite an “intimate” turn out, the session has already been a hit with me as it demonstrated the PSS Client Troubleshooting tool.


Yesterday the Student Day of TechEd Oz kicked off after a lot of hard work by Scott, Deeps, Bernard and I’m sure lots of others.  Although there were over 600 registrations the awesome line up of presenters was no match for the perfect Sydney weather, resulting in a high number of no-shows.


Following Student Day the Welcome Party got under weigh in the main exhibition hall.  This year CommNet uses Dell hardware, which is available for attendees to purchase.  This is a great deal and these machines are Vista Ready (in fact some of them are actually running Vista).


This morning Frank hosted the TechEd Keynote which had a fantastic turnout and provided a great introduction to TechEd 2006.  A couple of highlights for TechEd will be the “Ask the Experts” session this evening and the TechEd Party, tomorrow evening at Home Nightclub.  The theme for the party is “Show us your colours” so break out of those dreary colours and wear the colours of your favourite AFL, Rugby, Football or other sporting team!

TechEd and Professional VS2005 Book

Now that my 2 week snowboarding holiday is coming to an end it is time to focus on TechEd, which of course begins next week.  I'm presenting two mobility sessions, one on Windows Mobile Security and the other on building Windows Mobile Applications.  If you are doing any mobile development I would encourage you to head on over to these sessions and touch base with me!

The second point of interest is that I just remembered that the book Andrew Parsons and myself authored, entitled Professional Visual Studio 2005 is due for publication next monday (how good is that for timing).  Anyhow, for more information just scoot over to Amazon and grab this <talk-it-up>great</talk-it-up> book on working with the beast that is Visual Studio 2005.

Installing Vista build 5472.....please wait

After the weekly Geekzone coffee on Wednesday I was suitably enthused to go away and upgrade my Vista laptop from build 5456 to the most recent drop, build 5472.  Of course, this meant a 2.6Gb download, which on my Woosh modem took a little over 24 hours.  Last night around midnight I started the install of build 5472 of Vista.  After entering the product key (which I had remembered to record prior to nuking my only computer) and a few other configuration settings I decided to leave the installation and head to bed.  I woke up this morning to a completed installation.

Before doing anthing I of course stepped through the usual setup process of adding a user, setting up anti-virus (currently beta trialling the Vista version of Pc-cillin from Trend), installing Office 2007 and Groove 2007.  This took just over half an hour, leaving me just 5 minutes to configure Outlook to connect using RPC of HTTP. Overall I was suitably impressed that the whole installation process took a little over an hour of my time (primarily because I slept through the hour or so it takes to install Vista once it has gathered the necessary input - but at least it does this all at the beginning so it can continue without user interruption).

Ok, so I have to complain about one thing that frustrates me in IE7 (both on Vista and WinXP).  As our exchange server is only supposed to be accessible by SoftTeq staff the server uses a self signed certificate.  This of course means that IE7 complains about the certificate when you navigate to outlook webmail. It also means that Outlook can't connect to the server as the certificate is can't be authenticated.  In both cases the usual solution is to add the certificate into the list of Trusted Certificates.  In the past you could do this by clicking View Certificate within IE, then from the certificate information dialog there was a button entitled "Install Certificate".  Perhaps I'm missing it, but I can't find that button in IE7????  In the end I exported the certificate from a machine where it was installed, copied it across and manually installed it.

We have a winner - ECU Early Career Awards!

Following on from my previous post regarding the ECU Early Career Awards I am please to announce that last night, in my absence, I was nominated the 2006 winner in the Computer Science category.  At the time of this post the website hasn't been updated, but I'm hoping that my name will appear there in the next couple of days.

A big thanks to everyone who supported my nomination for this award, including everyone at the ACS, colleagues at SoftTeq, AutumnCare and Intilecta, and of course my partner, Meg.

Windows Mobile Developer Virtual User Group

Doing mobile development?  Yes? Well head over to the official website of the Windows Mobile Developer Virutal User Group.  The first meeting is set for tomorrow morning (AU/NZ timezone that is) and I'm hoping this will be the first of many virtual meetings hosted by the best in the business.

In the first meeting Nick Landry (aka ActiveNick) will provide an overview of mobile development, including an introduction to the tools and technologies mobile developers should be aware of.  This will be followed by a session by a presentation by Don Sorcinelli which will look at mobile application deployment, including security considerations that need to be addressed.

Mobile Client Software Factory goes Live!

In the past I've made reference to the work being done by the Patterns and Practices group at Microsoft on the Mobile Client Software Factory.  Just thought that I would encourage people to take a look as phase one of the development is now complete.  The factory comes as an installer (unlike previous drops) and goes through setting up the reference implementation.  You will of course need the Guidance Automation Extensions.

Large Enterprise - no excuses to build innovative solutions with SQL Server Everywhere

For those with a keen eye you will have noticed that the information surrounding SQL Server Everywhere (SQL/e) indicates that it is only supported for WinXP and above (ie no support for Win2K).  Back when it was SQL Mobile (SQL/m) there was support for Win2K, but the licensing prevented it from running on anywhing less than Tablet XP.  Most developers wouldn't need to worry about lack of support for Win2K.  However, if your target market is large enterprise (eg >1000 employees) there is a strong possibility that they still have large deployments of Win2K.  You might go in there with a revolutionary product, but if they have to upgrade 1000+ desktops just to use it, it is going to be a very difficult (if not impossible) sell.

So, why the restriction?  Well as the product team will no doubt attest it has nothing to do with whether it will run on Win2K or not.  In fact in all likelyhood it will run without any issues.  Further if there are issues, they are likely to be issues that pertain to WinXP as well, so would most likely be fixed anyhow.  The decision to "support" Win2K comes down to testing and support resources.  Although SQL/e is a relative small increment from SQL/m, to extend support from Tablet XP to both Win2K and WinXP is a significant investment in resources.  This is especially true in light of the fact that SQL/e is FREE!

Ok, so now some good news.  Over the last couple of days MS had a number of internal discussions and have indicated that they are going to support Win2K.  Although this is not an official announcement, you will most likely see a post in the next day or so to this effect on the SQL Everywhere Blog.

IE7 V's ANZ Bank

Last night I vented my ongoing frustration with the ANZ bank to good friend and fellow MVP, Sandi Hardmeier.  As far as banks go the ANZ IMHO is ok.  Since being in NZ they have allowed me to setup my accounts, including credit card, with minimal fuss.  I must admit I was surprised when they told me that I couldn't deposit cheques using the ATM and that I had to still fill in a deposit slip.....

Anyhow I digress, the point of my frustration this time around was that I couldn't access Internet banking using my newly rebuilt Vista machine (build 5456 before you ask).  Everytime I clicked on the logon button I would get a blank window.  In Sandi's post she reveals how to go about working out why a site might not display properly.  A big thanks to Sandi as I was able to not only access my Internet banking site, I was also able to isolate a number of issues that were causing the issue.


1)   Check the "Use SSL 2.0" checkbox under Tools -> Internet Options -> Advanced -> Security

2)   Enable "Allow the Pop-up Blocker to show Input prompts" under Tools -> Internet Options -> Security -> Custom Level -> Scripting