Upgrading MVC4 to MVC5 and WebAPI1 to WebAPI2 – MEF – DotNetOpenAuth

Originally Written 20 June 2014

So, if you have found this blog post as you are going through this process and have hit numerous brick walls I’m afraid I’ve got no answers.

I wasted 3 days on this process and by 3pm on the 3rd day I simply gave up and reverted my working copy back to MVC4.

it seems there are a number of breaking changes between MVC4 and MVC5 that just simply are not being talked about much and since I have a workload of 10 people at the moment I simply do not have spare capacity to sit down for days on end poking the framework to get it to work for me.

The security model in MVC5 is different meaning that DotNetOpenAuth is no longer working, which means Andrew Arrnott who WAS the lead (yes you read that right – WAS) had to issue a quick fix to DNOA so that it worked – DotNetOpenAuth MVC 5 extensions.

On top of all that faffing around with DNOA I found that I had yet more issues with the Microsoft.Bcl.Build stuff which is frankly a joke. Also the Attribute routing implementation that is now built in to WebAPI isn’t a patch on AttributeRouting. Crap.

Then for some reason which I could never get to the bottom of (hence the rolling back to MVC4) all my MEF code in my WebAPI solution simply stopped working. I have absolutely no idea why but all of a sudden my custom controller factory was simply bypassed by the whole pipeline meaning that anything marked as an import was left null. There is nothing talking about this online and I tried all mannor of code changes to try and figure out the problem and get it working but nothing fixed it. I have two open StackOverflow questions which I will keep an eye on:



So basically, upgrade at your peril, it may just eat through your time like a bastard, I gave up … for now.

UPDATE 30 June 2015

Amazingly this is almost a year to the date of the original post.  Again I have tried to migrate my MVC WebAPI and MVC Site over to the newer versions and again I have utterly failed and rolled it all back.  So many breaking changes and libraries that I’m dependent on that still just won’t play nicely.  I’ve wasted so much time and effort on getting this done that I have simply not got the time to carry on trying to push forwards with it all.

I have absolutely fallen out of love with DotNetOpenAuth.  It is a hugely over complicated library and I cannot wait to ditch it for something better.  It works for now and will have to do but I am not happy about how this library is put together.  It is hugely brittle and even the build process in the source code is horribly complex.

When will package authors realise that the more trickery you put into something the harder and harder it gets to support and for others to pick up and run with.  Not impressed.  Version 5 of this library has been in development since 2013 and is still only in an alpha state.  I’m going to move away from using this package at the first available opportunity I get.

I’ve also come to the conclusion that I’m not going to migrate to a newer version of MVC I’m going to build the MVC6 or maybe even MVC7 version from the ground up to make the most of the new features of the chosen replacement platform.  It seems the changes in 6 are profoundly deep, ASP.NET 5 doesn’t even support Web Forms for instance.  THAT is a huge development on its own.

Anyway, for anyone reading this and planning on doing the migration, good luck!


SSL Certificate Access – LocalMachine Store Access from IIS Express

Ever have this error – keyset does not exist?

Do this:

  1. Start -> Run -> MMC
  2. File -> Add/Remove Snapin
  3. Add the Certificates Snap In
  4. Select Computer Account, then hit next
  5. Select Local Computer (the default), then click Finish
  6. On the left panel from Console Root, navigate to Certificates (Local Computer) -> Personal -> Certificates
  7. Your certificate will most likely be here.
  8. Right click on your certificate -> All Tasks -> Manage Private Keys
  9. Add your account with full access



The Apple Developer Clique – MkII

So, today I got another email from Apple about my enrollment in their development program.

Turns out I don’t have to wait for another call, I got a very courteous email from them stating that they had seen my second application come through and since I had been through the process already they had “fast tracked” the old enrollment to make that one the active one.  So why cancel it in the first place?

The email even contains the statement from the Apple employee saying “I know how confusing our enrollment process is”.  Duh!

That isn’t the only confusing thing Apple does.  I had to use Safari and was told to clear out the history of cookies and credentials, why?  During the enrollment process the form to process the payment does some very odd (javascript?) actions that looked like their were doing something funky in the background but was visually confusing.  And then it insisted on mangling my phone number as the validation on the form is expected US style numbers and anything else appears to confuse it.

In addition to this when I clicked the nicely convenient link they had popped into the email to take me to developer.apple.com it hit some very weird Virgin “I can’t find that page link” so I had to then type that in manually anyway.  So I am now enrolled and am waiting for something to arrive in my inbox, I hope they aren’t going to email my signing keys …

Great job Apple.  So far I’m hugely unimpressed.

I wonder what exciting weirdness awaits when I try to actually do anything meaningful in XCode.


TeamCity CI Server Login Fails at Boot Up

If you’re running an instance of TeamCity on your local dev box, and who isn’t eh! haha, oh for more machines.  It’s highly likely that over the last two major versions (8 and now 9) that you are often, if not always, presented with something like this after boot up:

Cannot open database “TeamCity” requested by the login. The login failed. ClientConnectionId:f17b1159-b183-4241-bc98-c119d1767b49
SQL exception: Cannot open database “TeamCity” requested by the login. The login failed. ClientConnectionId:f17b1159-b183-4241-bc98-c119d1767b49

The issue is that TeamCity tried to connect to it’s database before SQL has finished initialising.  So obviously the login is going to fail.  I see this happening on every boot, a simply flick of the switch to restart the service and we’re off.

It’s very annoying and I’ve raised a bug report twice with JetBrains, once for version 8 and once for version 9.0.4 (the very latest at the time of writing).  Might seem like a trivial problem but there are a few things that directly contribute to this issue being out of their hands.  The driver sqljdbc_4.0.2206.100_enu sqljdbc4.jar is authored by Microsoft and seem to contain a bug in that it doesn’t always report the correct state.  Meaning JetBrains cannot reply on it’s response in order to Do The Right Thing™

SO … time to break out the batch file …

The (Hopefully Temporary) Solution

Make a batch file with this in it:

net stop TeamCity && net start TeamCity

And then setup a scheduled task to run 5 minutes after bootup and runas admin, sorted.


Xamarin – The Baptism of Fire – Windows 7

So as I blogged a few days ago about the issues I was having with getting to grips with all the issues I was having (which you can read here) it appears I’m getting to grips with all the added complexities of working on cross platform .NET based solutions.  There have been some incredibly late nights involved, surviving on 5 hours sleep a night for nearly a week has taken it’s toll I can assure you.

If you look at the other posting on the site of late, chiefly the Windows 8 post, you’ll see that despite all the Profile hacking I did I still wasn’t happy (neither was ReSharper but that’s another story).  I did end up migrating away from Windows 7 onto the Windows 8.1 Pro platform.

I’m a simple developer at heart.  Although I love all the neat tricks of .NET and using advanced interface based abstractions and Mvvm I still like to stick to first principles – simple is always better.  I didn’t like the fact that when I was dealing with lots of other peoples code and libraries my basic setup around Windows 7 wasn’t dealing with it properly or reliably.  Most of the things you’ll find yourself looking at deal in some way with a profile that the Windows 7 OS isn’t compatible with.  Profiles that target Windows 8 or Windows Phone 8.1 just don’t like it.  You can’t even installed the required SDKs  Windows 7.

So, I have moved on.  I loved Windows 7, it served me very, very well.  Was rock solid for me and I had a complex machine with an even more complex Windows configuration and until the last couple of weeks it motored on and munched through all my work.

Anyway, if you’re thinking of getting started with mobile development and Xamarin and you’re on Windows 7, upgrade.  It’s as simple as that.  You’ll save yourself lots of hacking around, late nights and stress when things go odd, and from what I can tell they almost certainly will.


Windows 8.1

Well I know, very late to the game on this one.  Problem is I loved Windows 7 as much as I did Windows XP and since I have a lot going on my development machine the priority is keeping that running not reinstalling every 5 minutes.

For various tasks I have had Windows 8.1 Pro installed in a Parallels VM on my Mac for about a year.   I rarely used it for anything meaningful though.  Other than to back up some SVN repositories and  some Café based code reviewing of my solutions so never really got to grips with it.  The only tablet I have is an iPad Mini running iOS for testing.

Anyway, after 4 years of hacking, slicing and dicing my Windows 7 box finally gave up the configuration ghost last week.  All hail Windows 7!  So seeing that I need to support Windows Phone 8/8.1 development I decided to migrate the VM OS onto my main development machine.

What on earth everyone complaining about?  I’m actually really loving the Windows 8 experience.  Granted there was about 5 mins of “Eh?” moments but all in all I think this is a great OS.  Feels REALLY fast, yes I know this is a new installation but even my main tools like Visual Studio and ReSharper feel much snappier in response.

Just a month before Windows 10 appears … hmm …


Apple Music Service – The Swift U-Turn

The more Apple get in the news the more I wonder how long they can keep up with this “cool” image they seem to have.  Yes they make nice looking devices but their business practices stink.

It was their choice to offer this new music streaming service for free, not the artists.  If you wish to make that gesture for your benefit that’s fine but how dare you even think that you should not pay the copyright owners.  As far as I’m concerned that is institutionalised theft on a grand scale.

Well done to Taylor Swift for speaking up and shame on all the others that didn’t.

As a one time budding musician and commercial studio owner I know just how hard it is to breakit in that industry and three months of massively reduced income for many small labels would literally be the death-knell for them, for Apple it would be a minor blip in profits if that.

Shame on you Apple.  The Tweet from Eddy Cue “Apple will always make sure that artist are paid iTunesAppleMusic” just appears like the damage limitation crap that it is.

For anyone now moaning about Taylor Swift – You’d moan about any “rich” artists raising this issue and go on a witch hunt for them.  Stop your whinging and appreciate that Apple would only listen to someone in that position.


Restoring YouTrack Backups

I love JetBrains software, I really do.  How I’d get by without ReSharper is anyone’s guess but they are not issue free by any stretch.  There also seems to be some very odd issues with their documentation a lot of the time as well.  A real shame since considering how nice their products are and how easy they are to get going with the processes of migrating to new version can be a bit hit and miss – if you follow their docs.

A case in point is YouTrack.  I’ve just had to reinstall my server that runs my local instance of YouTrack.  Now an issue tracker for a developer is insanely important.  It will more often than not contain lots of hard earned intelligence not to mention priorities for work and ways for lots of disparate team members to communicate.

I was running YouTrack 5.2.5 and I had that configured to do automatic backups.  So looking at the JetBrains instructions on how to restore a backup looks remarkably straight forward (it is by the way just not how they describe!):

Skip to end of metadata

Important note
For successful restoring, version of the backed up database should be the same or older than the version of YouTrack, to which you restore this database.

To restore a database from a backup, proceed as follows:

  1. Download a backup tar.gz file via web UI from the Administration > Database Backup page or locate a needed backup file directly in the specified backup folder on the YouTrack server machine.
  2. Stop YouTrack server instance.
  3. Clean all content of the database location directory. By default, the database is located in the teamsysdata folder in the home directory of a user account, which starts YouTrack. You can change default database location, for more details please refer to the Changing Database Location page.
  4. Extract the downloaded backup file to your database location.
  5. Start YouTrack.

The instructions I’m about to write below work for 5.x and 6.x (I’ve tested these on both versions and they work).

Firstly the backups I have generated from YouTrack are not tarbals, they are .zip files, this is configurable in YouTrack but I cannot find anything on the JetBrains site that details the process for zips so I can only assume that either configuration will result in a file that contains the same data.  Anyway, I digress.

So mistake number one, no mention of zip files.

The Solution

In step three is says – Clean ALL contents of the database directory.  DO NOT DO THIS!!  If you delete all the files in there as suggested and then dump the contents of your backup ZIP into the directory, it doesn’t work.  At least it didn’t for me.  Also the teamsysdata directory they mention in this article referrd specifically to YouTrack 5.x yet this article was written in 2012 and is also part of the 6.x documentation.  YouTrack 6.x is vastly different to 5.x and does not use the same structure for the database at all.

What I do (and always works for me) is:

  1. Logout of YouTrack
  2. Stop the YouTrack service
  3. Remove the existing 00000000000.xd file from your YouTrack database directory (your file name maybe slightly different)
  4. Copy over your backup *.xd files into the database location – mine were called (00000010g00.xd, 00000010o00.xd, 00000011000.xd)
  5. Copy over your blob directory into the existing blob directory
  6. Leave all the other files in place and untouched
  7. Restart the YouTrack service
  8. Login under the root account
  9. You should now see your restored issues

Personally I don’t understand how a company that makes such great things as ReSharper can make such glaring issues in their documentation.  Certainly when it refers to something as important as restoring backups of your hard earned intelligence.

Anyway, I hope this helps and clears up some confusion surrounding this issue.  JetBrain, if you are listening please sort this out.


Why are Hardware Manufacturers Web Sites and Documentation Like Black Holes?

As some one that has built a large number of PCs and servers over my career I’m constantly surprised by how products I have bought and used can utterly vanish from their web sites.  Like they are an embarrassing aunt that gets too drunk at Christmas and no-body wants to mention.

Even some reputable companies like Plexstor.  I cannot find my drive mentioned anywhere on their web site anymore.

This has been prompted by a recent issue with a my Lacie D2s.  Great drives.  They have this feature of a “one-click backup” that you can initiate from the drives themselves by pressing the illuminated blue button the front of the drive.  But it’s never worked for me.  Their documentation doesn’t mentioned anything about how it works and their “troubleshooting” page on their site is laughable at best.  All it says is “update the drivers”.

On Windows 7 I gave up trying to get it to work.  I’ve just upgraded to Windows 8 and still couldn’t get it to work.  I just rebooted at for the first time ever I just saw a little bubble message that read:

“Cannot configure Lacie Shortcut Button, Shortcut button is incompatible with Firewire, use USB instead”.

Er … Okay.  Firstly, why isn’t it compatible with Firewire, I can’t think of any technical reason that wouldn’t work.  Secondly, why is that only mentioned in a driver that I shouldn’t have even installed since I do only use them with Firewire?  Poor show guys.


The Apple Developer Clique

I’m genuinely gobsmacked by this.

I applied for the Apple Developer program a couple of weeks ago on behalf of the company I co-founded.  I was amazed to find out that I had to provide them with details about myself, details about my company including things like our DUNS number.

In addition to this I had to wait for them to call me … yes, CALL me.  Just so that I can get a set of digital keys to sign anything I build.  So I waited for the call which took a little over a week.  The checks they did in this call were frankly pathetic:

Them: “Hi Apple here, you applied for the developer program on behalf of <company>?”

Me: “Hi, yes I did”

Them: “Can you confirm you are <name> and can you sign things for your company?”

Me: “Yes I can”

Them: “OK, thanks.  I’ll update your application now, bye.”

I mean seriously Apple what is the FUCKING use of “check” like that??  I could have been bloody anyone on the end of that phone connection.

So, I then had to wait for that to filter through the system.  I got distracted as busy business types generally do and got on with other things to make better use of my time.  An email arrived on the 10th June saying that I could now finish the application.  So today (20th June) I’m in a position to get it paid for (I’ve got to PAY Apple to make their eco-system more attractive??? WTF??  I won’t go into how offensive I find that here).

BOOM!!  Because I didn’t cough up my cash quick enough (within 7 days) I now have to go through this laughable application/wait/phone call process again.  I have to apply again, giving all the same details AGAIN, wait for another impossibly stupid phone call and another email.

Just so that I can hand over the stirling equivilent of £110 (not $99) so that I can spend my time making an app for my company.

Seriously, Go fuck yourselves Apple.  Take about a little clique!

“Ohhh, you didn’t respond quick enough, oooh, oooh … you need to be faster than that … Oooh, join our little club you want do you?  It’ll cost ya.”

Yeah, well I’ve already paid a massive premium for the bloody laptop I’m using.


PCL Profile 259 in Visual Studio 2012 on Windows 7, Xamarin, MvvmCross & ReSharper 7.1

Well, today was a lot of fun.  You can tell just how much fun from the ridiculous title of this blog post.

I’ve lost most of a productive day to this set of issues.  I was seeing some errors being reported by ReSharper 7.1 in my PCL and Xamarin Android solutions and couldn’t work out what the issues were.   They compiled without any compiler issues being returned and ran on the various emulators as expected, again without any issues or exceptions.  Consdering the error reported by ReSharper was Module ‘System, Version=, culture-neutral’ should be referenced.  An error of that sort, if “real” should mean an application would have trouble even starting up let alone running.


I’ve basically been round the houses trying to sort this out.

Considering the problem centered about MvvmCross I decided to have a look at the source for that so cloned the repository and started having a poke around.  Now the first problem you’re going to encounter given the VS2012 and Windows 7 constraints is that Windows Phone requires Windows 8 for development.  The WP8 SDKs won’t even install onto Windows 7 so those projects are dead in the water.  This target .NETPortable Profile259 which cannot be installed on Windows 7.

So when I opened the MvvmCross solutions on my machine I was seeing some very odd behaviours.  You can see some of the weirdness in the following screenshots:


The Cirrious.CrossCore solution targets Profile 259 (the new Profile78 basically with Windows Phone 8.1 support thrown in – unavailable on Windows 7).  So what has been happening is any of my own projects that link to this library are trying to resolve system.dll v4.0.0.0 through Profile259.  Since I don’t have this profile ReSharper was correctly informing me of an issue but incorrectly informing that I’ll get a compiler error as a result.

In order to arrive at this solution I had upgraded ReShaper from 7.1 to 9.1 only to still see the issue.  Reinstalled all of Xamarin and even contemplated a fresh Windows install (not a small task).

The Solution

The solution turned out to be fairly simple.  Kid the system into thinking that my operating system DOES have Profile259 by copying the XML files from:

C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.5\Profile\Profile78\SupportedFrameworks


C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.5\Profile\Profile259\SupportedFrameworks

This doesn’t fix the issues I see when opening the MvvmCross solutions, they still compain about not finding system.dll but it has meant that my solutions that reference Cirrious.CrossCore do not throw up the problem of highlighting “non-issues” in my own projects.

So that was a hell of a learning experience.  And I did pull the trigger on an update to ReSharper 9.1 after complaining to JetBrains that 7.1 cost £110 and an upgrade to 9.1 cost £122!  So they gave me a 25% discount!  Yay!

Thanks JetBrains.


Downloads Broken – Fixed

Must put an apology online.  I’ve had a few enquiries today as to why some of the code examples on the site are currently unavailable.  I’ve just found out that in a previous update to the WordPress plugin Download Manager destroyed a lot of download entries in the database and orphaned a lot of links to the download files.

I’ve just rebuilt all of these so all the downloads on the site are now back up and running again.


Should I Download MacKeeper?

I’ll cut to the chase – NO, DO NOT DOWNLOAD this “software”.

MacKeeper is one of those apps that seems to pop up everywhere offering to fix all over your problems and more or less upgrade your life along with it.  Do not fall foul of this software, far more people report problems with it than you can shake a stick at.  They’re marketing tactics alone should warrant serious concerns a lá Parallels.

There are precious few tools that I’ll recommend for any platform in addition to the tools that arrive natively on these platforms.  OSX has some neat built in maintainance tools that you can use, if you leave your Mac on overnight it will probably execute a bit of maintainance for you without any prompting.

Generally I find the tools offered by Piriform to be excellent.  Their CCleaner app is available for PC and Mac and I make use of it all my machines Windows and OSX.

If you have been duped into downloading the trial for MacKeeper, get it off your system, NOW and never look back.


This is AMAZING – Female Genital Mutilation Finally Outlawed in Nigeria

This is such great news.

“More than 130 million girls and women have experienced female genital mutilation or cutting …”

“Nigeria made history by outlawing female genital mutilation. The ban falls under the Violence Against Persons (Prohibition) Act 2015 that was passed in Senate on May 5 and recently enacted into law.

This was one of the last acts by the outgoing president, Goodluck Jonathan. His successor, Muhammadu Buhari, was sworn into office this past Friday, May 29.”


Cover photo courtesy of: Graeme Robertson, via Getty Images.


Code Reviewing – Xamarin Components and MvvmCross Plugins

At the moment I’m working through the implementation of a mobile application build on top of the Xamarin platform targeting Android, iOS and eventually Windows Phone as well.

I’ve done a lot of Mvvm in the past with various personal and commerical WPF applications so not a lot of this is new.  The paradigms are very familiar but some of the approaches are new.  I’ve not done a whole lot with Portable Class Libraries for instance.  I’m also new to the device platforms I’m working on as well but viewing through the familiar C#/Java code makes things a lot more comfortable even if the underlying implementations are slightly different.

I’m reviewing a lot of security code at the moment, plugins and approaches and frankly I’m slightly concerned by what I’m seeing.  Before I say anything else I’m finding the development flow with Xamarin and MvvmCross to be really great.  Both of these platforms and frameworks are really great.

Lots of hardcoded strings used for encryption.  OK, not so bad considering the inevitable trade off between reliability, ease of use and the areas where one is comfortable to accept some risks given the contexts.

With all that said I’m seeing some very poor coding practices employed in some areas.

  • Lots of badly formatted code(not following established coding standards)
  • Code littered with magic strings even within the same class file.
  • Numerous instances of “” rather than string.Empty.  (pedantic? maybe but mobile apps need to be effecient and this simply isn’t)
  • Swathes of methods and properties with no documentation or comments.
  • Lots of hardcoded values not stored in constants

That is just lazy coding, nothing else.  A quick run of any of the code analysis in Visual Studio will highlight all of this.  It seems that none of the component authors I’ve seen thus far have ReSharper for instance.  Some of this I’m seeing even in released components available through the Xamarin Component Store.  Really not good.

I’m also seeing some components named in such a way that if you didn’t review the source code you could easily assume they are doing something when in fact they are not.

The long and short of it is I would suggest that you review the code for any component you plan to use before shoving it all in your solutions and forgetting about it.  You really shouldn’t be doing that btw, not when the source code is available to see online via a simple left click!!

Anyway, I’m finding lots of good examples of how to do things but relatively poorly implemented in many instances.  So far I have basically backed out from using any components in favour of implementing them myself.  In the small number of cases when I have used a component I’ve made notes in the classes, added tickets to YouTrack and added TODOs in the code that will be reviewed and ported into my own codebase prior to product release.


Example – IHS.MvvmCross.Plugins.Keychain

I’ve been building my own proprietary solution to interact with the various keystores on the mobile platforms.  I have to say that I’m loving the architectures.  Having come from years of WPF/Prism/Mvvm this all feels like second nature to me these days.  But along the way I’m finding some real horrors, it has to be said.  Take this as an example:

<br />
public string GetPassword(string serviceName, string account)<br />
{<br />
    var storedAccount = FindAccountsForService(serviceName).FirstOrDefault(ac =&gt; ac.Username == account);<br />
    return storedAccount != null ? storedAccount.Password : null;<br />
<p>private IEnumerable&lt;LoginDetails&gt; FindAccountsForService(string serviceId)<br />
{<br />
    var r = new List&lt;LoginDetails&gt;();</p>
<p>    var postfix = &quot;-&quot; + serviceId;</p>
<p>    var aliases = _keyStore.Aliases();<br />
    while (aliases.HasMoreElements)<br />
    {<br />
        var alias = aliases.NextElement().ToString();<br />
        if (alias.EndsWith(postfix))<br />
        {<br />
            var e = _keyStore.GetEntry(alias, _passwordProtection) as KeyStore.SecretKeyEntry;<br />
            if (e != null)<br />
            {<br />
                var bytes = e.SecretKey.GetEncoded();<br />
                var serialized = Encoding.UTF8.GetString(bytes);<br />
                var acct = LoginDetails.Deserialize(serialized);<br />
                r.Add(acct);<br />
            }<br />
        }<br />
<p>    r.Sort((a, b) =&gt; a.Username.CompareTo(b.Username));</p>
<p>    return r;<br />
}<br />

I literally do not know where to start to point out the problem and inefficiencies with the code I’ve shown above. What’s wrong with doing this instead?

<br />
var alias = MakeAlias(username, serviceId);<br />
_keyStore.GetEntry(alias, _passwordProtection);<br />

Why iterate over every single possibly stored value in the key file, then deserialise each entry in the store, build a list containing many entries and then pull out the specific one you are actually looking for? What a complete waste of valuable resources!!!


Unit Tests in User Configurable Applications

Yesterday was another one of those little lessons in Unit Testing.

In one of the applications I work on there is a lot of clever string manipulation in order to derive intelligence from the data contained in the string.  Lots of array generation and scoring of individual elements within those arrays and so on.  The problem was during debugging within Visual Studio I was getting the desired output from the process I was unit testing.  All good.  The problem was as soon as that same test hit the build server it was failing.

I spent quite a while trying to track down what might be happening.  Since it was all geared around string manipulation I was looking for something related to any string comparison code I’ve written.  Is this a culture issue?  Am I making some obvious mistake with how some of the arrays are being treated?  Round and round looking at the same code trying to figure it out.

Those moments when your “coding cool” starts to ebb away and morph into pure frustration at mild annoyances.

After about an hour (a few cups of coffee) I suddenly realised what the problem was.

Since I was obviously debugging within Visual Studio this making use of the application in the context of which I have been using the application to debug.  Meaning that the user configurable options that I have set were being used.  This was not the case on the build server as the application hadn’t ever been run on that machine and certainly not in the context of the build servers build process.  So the two were not matching in configuration.

The setting in question allows the user to switch on deeper “fuzzy matching” on the string manipulation code.  If the code runs through it’s normal matching process and still hasn’t found an obvious match if this “Use Fuzzy Matching” item is turned out another set of rules come into play and the system then attempts to make a fuzzy “best guess” which, obviously, will create a different result.

So, todays lesson is when there are user configs involved in the code being tested, make sure you explicitly set these in each unit test!


Get Windows 10 App & Skype Login Broken Fix

So yesterday a new icon appeared in my Task Tray.  A little Windows icon representing the Get Windows 10 App offering the free upgrade.  Great!  Er … not so fast.

I opened the UI and was presented with this monstrosity:

GWXEr, nice.  It appears to be thoroughly brokwn as well.  None of the links do anything at all.  A little message above the “Learn more on windows.com” saying “Please wait …” appears for a fraction of a second and then … nothing.  Apparently this is supposed to look like this:


I’m not feeling the love right now.  Also the idea of updated the OS on my main development machine feels me with a feeling of dread if I’m honest.  Updating major versions of Windows in the past has been problematic and my machines are all far from your avarage users machines.  Highly configured and rammed to the gills with all kinds of software powering my development processes and build environments.

I think I’ll be holding off on this for a while.

The Fix

To get these problems solved you need to make a change to the Windows registry.  If you aren’t familiar with regedit you need to be very careful.  Make a backup copy before you do anything in here.

  1. Launch regedit (click on start and type regedit and then press enter)
  2. locate this key HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.css
  3. The Content Type will be “application/x-css”
  4. Change this to “text/css”
  5. Close regedit

Problem fixed!