Wednesday 19 February 2014

64-bit Considered Harmful...

Thought I should write about a problem I ran into last month in the hope that it saves someone else some heartache (or potentially someone tells me how to fix it...)

A few weeks ago, while I was searching for something else in Visual Studio's Settings, I ran across this option:
I run on 64-bit Windows, so I figured this would be a sensible option to set and switched it on. And all was good in the world.

Until I started on a new project a couple of weeks later, that is, when running it up for the first time I was puzzled to see this YSOD:
Invalid program? What the hell's that coming from? The only thing that I could immediately think of was that the last thing I did before hitting F5 was to install Ninject. I cast around for an hour or so trying assorted types of restarting processes/PCs etc, before going to Twitter...

Fran quickly replied with this:

which was the clue I needed:
And yep, as soon as I turned off 64-bit IIS Express the world righted itself...

So I'm interested to know what causes this and whether there's a way to successfully run Ninject in 64-bit code (I'm quite prepared for this to be something related to my inexperience with Ninject).