System.BadImageFormatException Could not load file or assembly System.Data.SQLite

I ran into this problem when I tried to re-open a solution I did a while back when labbing with Fluent NHibernate and SQLite.

Behind the cryptic error message lies and easy solution; I was running the 32-bit version of the SQLite-driver and runtime. That’ doesn’t fly on my Windows 7 64-bit machine.

Here is a more through description and here is a link to the latest version of SQLite that will get you all the version (32 and 64 bits) of the SQLite.

Read More

Synchronization for consultants – it works!

I am so proud. My evil scheme to keep my calendar(s) in sync got tested for real today.

Got to new customer. Installed Outlook to Google Calendar. Started Outlook. Viola! All my events from my other calendars in place with the ones from my customer. So now they will not book me on days when I have other assignments etc.

The only thing is that you cannot think to much about it because it will drive you mad. My customer Outlook is synched with Gmail, my Avega outlook is also synched with the same account to Gmail. My phone synchs to Gmail… But it works. ‘Nuff said.

Read More

AutoMapper – get rid of your tedious mapping code

One thing that I really love being on a contract is that you’re almost immediately is forced to find solutions, whereas on a leisure project you rather do something else…

Here is another great tool; AutoMapper. It’s a framework that do all of that tedious mapping code you’re doing in for ViewModels or Messages in services. Boring and tedious to write and test. AutoMapper takes care of that – using a lot of Conventions.

Be sure to see the screencast that introduce a lot of the possibilities.

Read More

SpecFlow BDD .NET-style

As you could read in my latest post I have be a bit frustrated with TDD and where to start, lately. BDD is of course the answer to that. But I must say that the frameworks are available to the .NET crowd is a bit weird. Either you have some really funky syntax (hey Anders, a new colleague and great guy) or it’s build on top on other stuff and where hard to work with.

I simply cannot see myself introduce any ordinary programmers to any of that.

But here is something that looks more like it… a bit at least; SpecFlow. It’s also built with an eye too RSpec, Cucumber and Ruby but build in the style of .NET and C#.

Here is a (silent) screencast, something about syntax...

Read More

ASP.NET MVC, StructureMap and … TDD?

I’ve been playing around a bit with ASP.NET MVC and StructureMap (an IOC container). It all looks very nice and works wonder. During this I ran into an excellent blog post by Elija Manor on wiring StructureMap and ASP.NET MVC together. Beware of the favicon-problem though.

Again – i use NHibernate and Fluent NHibernate which so much nicer than the XML-stuff. The critics to Fluent NHibernate says that you cannot reach all functionality from Fluent NHibernate, but here is an example on how to set specific properties in your configuration. Helped me through this example.

Also found some great code examples from the TekPub NHibnernate series here.

OK – I’ve added “TDD?” in the title. I love TDD and it’s my preferred way of doing code, but Read More

Visual Studio 2010 web.config transformation

I happened to run into a feature I didn’t know of… Visual Studio 2010 (beta still… soon RC) includes a function for managing different .config-files for different environments. And support for transforming them on build/publish.

Here is a MSDN-article that introduces the concept and use it. And here is an article on the subject.

Pretty cool since up to now you’ve had to do it manually with build-tasks… Not so trivial.

Read More