Enabling Entity Framework Code First Migrations ProviderIncompatibleException

Quite simple actually … make sure the connection string in your config file is named the same as your context class OR make sure you do something like this public MyContextName : base(“connectionstringname”).

It’s also worth checking the name of the connection string being used in the configuration file for the start up project if your data context is in a class library as this is the connection string that will be used.


RIP FireFox (at least until v30 anyway).

That’s it.  I’ve stood by you and defended you but today was just it for me.

I really don’t know what’s happened and I’ve exhausted all solutions I can think of.  I’ve reset your settings, removed Firebug and reinstalled it.  I’ve even backed up my profile, reinstalled Firefox and restored  my core profile data (from the reset version of course).  Nada, nothing.  Firefox 29 is just unusable for me now.  Today I wasted an hour trying to locate and fix a bug in an MVC site that just works everywhere else (Chrome, Safari, Opera, IE YES even IE) Firefox just sits there.

Ever since the FF 29 update you just haven’t been the same, slow, crashy and just not fun to use at all.  Even switching from one tab to another has taken a lifetime.

I have switched to Chome …

… for now …



OSX Mavericks Wi-Fi Not Reconnecting

OSX weirdness strikes again.  In the year I’ve been using OSX I’ve been surprised a number of times by oddities and general weirdness and I’ve just had another experience of this ilk.

After I updated the OS to 10.9.3 (Mavericks) my Wi-Fi would never reconnect properly on a reboot or a wake from sleep.  I tried various solutions listed on the Apple discussion sites none of which worked, the last in the list of solutions was to reinstall OSX!!  Which coming from a Windows world seems drastic in the extreme.  It used to be one of those running Windows jokes – reinstall windows, sheesh it’s such a nightmare OS isn’t it blah, blah.  Well since I upgraded to Windows 7 I have to say that it is a brilliant OS, better than XP and XP was damn fine.

Anyway, I appear to have finally fixed my Wi-Fi issues!  What was the issue?  A dodgy BLUETOOTH plist file … BLUETOOTH config cocking up my Wi-Fi?  Yeah, that makes a whole lot of sense – said no-one ever.

Seriously, OSX is not the be all and end all apple devotees make out.  I’ve read about all kinds of plist problems on all their platforms.

So to fix …

1. Open a finder window

2. Click on Machintosh HD in the right hand panel

3. Open the Library folder

4. Open the Preferences folder

5. Click and drag com.apple.Bluetooth.plist to your desktop to make a copy of it

6. Click and drag the com.apple.Bluetooth.plist file from the Preferences folder into your trash bin

7. Enter your password in the window that pops up to actually move it to the trash

8. Restart your mac

Under some situations you may have to re-pair your bluetooth devices but I didn’t and my Wi-Fi reconnected to my home network immediately like it used to before the Mavericks update.

Confused?  You should be …

If all goes to plan, delete the com.apple.Bluetooth.plist on your desktop and banish this problem to he bin for good.


Mvvmcross (Mvx) Getting Started

I know the title suggests this is a guide on how to get started and since I haven’t even started yet it’s a tad premature eh!

Anyway, over the last few years I’ve done a LOT of WPF development and I’ve almost exclusively used MVVM in all of the applications I’ve built or designed over that time frame so the concepts are far from new.  You can see a write up of a lot of the concepts in MVVM and DI in my CodeProject Article (part1 & part2).

What is new is mobile development and the Mvvmcross framework.  Just found and watched a brilliant little video introduction that covers a lot of ground in a very short space of time.

You can watch it here.

There is also a really impressive video of Stuart Lodge demoing Mvvmcross at NDC.


Cross Platform Development w/ Xamarin & SVN Source Control on OSX

Hmm, rather ambitious title there Jammer …

Anyway, I’ve just started looking at building some iOS and Android (plus others in the future) development and have so opted to use Xamarin as I’m primarily a C# developer and I have a LOT of custom .NET code in my arsenal it makes the most sense.  I can also share all the same business logic and class libraries across all the products I develop which is a massive win on many levels.

Anyway, I have a massive Subversion repository on my main development box running Windows 7 that contains the ASP.NET MVC web site and also the main WebAPI project that all the various components in the system essentially use as the data access layer.  Some of the more key security elements are initially only going to be available on the web site so there is a small sub set of data access portions of the solution coded directly in the web site project.

Now that I’m going to be working on the iOS and Android solutions I need to get the mac integrated into the work flow.  On the mac I also have parallels installed which is running Windows 8 in a VM, I also use this for some development so that checks in and checks out code from the main Windows 7 repositories using TortoiseSVN.  On the mac however the SVN client world seems a little more fragmented, the only direct analogies to TortoiseSVN are all commercial solutions with all the free tools really lagging on functionality or they seem to be in a abondonware state despite the fact that OSX actually ships with SVN already installed (see the SVN upgrading guide I posted a couple of days ago).

For my OSX client I’ve actually opted to SmartSVN as this seems like a well maintained and comprehensive solution that is also commercial but pretty well priced at $69 but thee foundation version is actually free but as you would expect it does lack some key features.  No real surprises there.

Anyway, the reason for this post was getting OSX integrated into the source control aspects of things.  The Windows 8 VM has no issues connecting to the Subversion repository on the Windows 7 box.  I have VisualSVN Server installed on the Windows 7 box to provide easy configuration of how SVN exposes the repositories over http and https.  The problem I had was getting OSX to play nicely with the windows 7 box.  Everytime I tried a checkout I would get this error:

svn: E120108: Error running context: The server unexpectedly closed the connection.

Basically OSX cannot resolve the Windows 7 box by name on the network (a Wi-Fi router).  To get around this issue I didn’t want to go through the process of installing Bonjour on the Windows 7 box so the only other option is to give the Windows 7 box a static IP address on the network and then map that IP address to the server name.  Considering all the machines get their IP addresses dynamically from the DHCP setup on the router I decided that the easiest way to deal with this was to actually setup an IP reservation in the router for the Windows 7 box.  That way I haven’t assigned any machines static IP addresses but the router will always apply the same IP address to the Windows 7 box.

Once this was setup up I edited the hosts file on OSX and added a line in like this: jamhq

And voila, I can now checkout the repositories to my instance of OSX and get on with the development.  I’ll no doubt blog about this again if I find anything useful that others may benefit from.  I’ll also be writing up my experiences using Xamarin.


Updating SVN in OSX Mavericks

Well that was an interesting hour wasted spent updating SVN.

I found this write up on how to perform this update and ran into quite a few problems.  The first is if you get a “cannot compile C programs” you probablt build the wrong symbolic link.  If you are on Mavericks, this needs to be:

sudo ln -s /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/ /Applications/Xcode.app/Contents/Developer/Toolchains/OSX10.9.xctoolchain/

Then the next error I had was “configure: error: cannot run C compiled programs.” which probably mean you don’t have the command line tools installed along with XCode so run this:

xcode-select –install

Then carry on with the rest of the command in the write up.  I also didn’t have a bash profile setup so do this:

cd ~/ (changes to your user home directory)

touch .bash_profile (creates a bash profile file)

open ~/.bash_profile (opens the bash profile you just created)

Place this in your newly created bash profile:

export PATH=/usr/local/bin:$PATH

Save and close the file, then log off OSX and then log in again.  This forces the system to read the new bash profile file and execute any commands it finds in there.  Then open another Terminal window and execute the following command:

svn –version

This should now correctly report than you are using SVN version 1.8.0 (or whatever version you initially downloaded).


Source Control Organisation

I’m not sure why people do this if you’re about to start a system re-write. Especially if you are also re-writing an application in a new language. Maybe you are updating from VB6 to a .NET application.

Why lob all of this new spangly beautiful code into the same old tired repository?

It gets confusing for anyone coming into the team cold and trying to get up to speed. It gets confusing to know what 3rd party binaries are old and which are new.

You’ll also end up with a potentially MASSIVE repository that contains stuff you need and stuff you no longer care about …

Create a new repository people!!


Firefox 29.0.1 Update

What on earth has happened. I’m getting script errors left right and center making my favourite browser extremely lumpy. Seems the theme I was using was causing problems so switched to the default theme. A bit better. Turned off Firebug as it seemed the firebug scripts were causing problems. A bit better again … still not right though! Anyone else seeing this?