How to run NUnit tests created with VS2010 and .NET 4

1 comment

Monday, January 25, 2010

Today when writing tests for a new project built using VS2010 I had an interesting problem:

NUnit would not run my unit tests because the assembly that contained my unit tests was compiled using a newer version of the .NET runtime.

There are several solutions to solve this issue from downgrading my project to use earlier version of .NET to migrate my unit tests to MSTest but luckily for me no such drastic move was needed.

The new NUnit (2.5.x) have support for running tests using .NET 4 it’s just hidden inside a pile of xml.

The solution

To run .NET 4.0 test assembly add the lines below to the relevant config file, so if you’re using NUnit.exe update nunit.exe.config or if you’re using nunit-console.exe use nunit-console.exe.config – you get the point.

  1. Under <configuration> add:
    <startup><requiredRuntime version="v4.0.21006" /></startup>
  2. Under <runtime> add:
    <loadFromRemoteSources enabled="true" />

I’m using the latest VS2010 RC2 If you have a different version of Visual Studio installed change the version value to the version of the .NET 4 installed on your machine – look at C:\Windows\Microsoft.NET\Framework to find out which version you have.


That’s it!

Seesmic look – the twitter client for your mom

No comments

Sunday, January 24, 2010

I use twitter quite a lot and I’m always on the lookup for a new way to read it’s almost endless stream of data. Today I’ve found a new and interesting client from the people who brought the first window native twitter client – Seesmic.

Seesmic look takes a new approach to showing twitter and it’s intended for users who do not use twitter and would likely be intimidated by the amount of twits and – in fact hey aiming on introducing twitter to less technology swavvy crowd:

It's not just for your typical Seesmic user with an online presence, but something you may want to introduce to your non-Twitter friends or family. Go ahead and show it to them and see what they say. With Look, we hope you're able to show them and better explain what Twitter is all about - even train them about social media.

It is also a great example of what can be done using WPF:




Have a go – download it here and try and introduce twitter to your friends and family

Real world unit testing presentation

No comments

Thursday, January 21, 2010

If you the Israel .NET Developers User Group (IDNDUG) and you’d like to learn more about unit testing you can view my presentation here.

I talked about unit tests and how to write good unit tests in the first session. I had a lot of fun and I hope that so did my audience.

Additional resources

During the break and after the 2nd session (done by Gil Zilberfeld) some of the participants asked what addtioanl resources are available for developers who want to learn more about unit testing – so here they are:

Why you want to be a Polyglot programmer

No comments

Tuesday, January 12, 2010

Polyglot programming defined

From Wikipedia:

Polyglot (person), someone who aptly and with a high level of fluency uses many languages. The word derives from the Ancient Greek πολύγλωττος (poluglōttos, “'many-tongued, polyglot'”), from πολύς (polus, “many”) + γλῶττα (glōtta, “'tongue, language'”)

The term was (probably) coined by Niel Ford in his blog post Polyglot Programming (from 2006) – or not have a look at We Aren’t Too Stupid for Polyglot Programming for more details (Robert Fischer).

Simply put (because it’s all Greek to me) – Polyglot programmer is a programmer that know several programming languages. So Polyglot programming is using several languages in the same project.

Is Polyglot programming a good thing?

Using multiple languages in the same project can be a hassle – I have been at a company that had both C# as well as VB.NET used in the same project without any good reason other then the fact that it was maintained by two developers, one preferred C# and the other VB.NET.

At the end the company decided to work only in one of these to make the code more usable and maintainable.

So is using multiple languages in a project a bad thing – not necessarily, in fact you might be doing it right now:

Do you used a database? RegEx? what about XML? although these are not “classic” programming languages they have domain specific languages that you use to make them work. Many developers use some scripting language to administer their machine or for the project build process – one could argue that that is part of the project as well.

In fact when thinking about all the project I was part of I can’t think of a single project that had only one programming language involved in it’s creation – my favorite is using C# along with C++ for low level programming.

The .NET framework provides a good platform for multi-language programming but that concept is not new. C, Python, PHP, Java are just a few languages that can used in a Polyglot project.

The Polyglot programmer

Do a developer today can make do with learning a single language (e.g. Java, C#, C++) and using it throughout his career? It is a possible (although improbable) scenario.

If all of your projects require only one language do you really need to learn additional languages? I think so…

The first reason to learning additional programming languages are the tools of our trade and learning more languages mean you have more tools to choose from.

The second reason is that by learning different languages we actually learn different ways to think about the problems we’re solving in our everyday work. I know that learning dynamic language helped me become a better C# developer.


Nowadays it’s almost impossible to do your work without constantly learning new technologies. You do not want to be that guy who gets to a point at the project and stops because he do not know XYZ.


My suggestion to you is to make a new year resolution – learn a new programming language.


Related reading:

Two (and a half) development links from the past

No comments

Wednesday, January 06, 2010

There are quite a few link blogs out there, like Alvin Ashcraft's Morning Dew, The Morning Brew and Tech Tweets. These sites help to stay on the bleeding edge by providing new links daily.

Perhaps I’m getting nostalgic because of the new year, instead of posting links from the last week I’d like to post two links from the past:

Two links

We will not ship shit (Robert C. Martin) – a blast from 2003 that is still relevant today and would probably be relevant as long as software is being written. This article explains how we sometime fail to produce a quality software while blindly following rules. He talks about how the rules of our trade can be broken as long as we are responsible to provide value and create high quality product.

If you have a team member (or manager) who insist of doing something just because it’s “best practice” or because the team is committed to follow XYZ methodology. Ask him if it help provide value to the product and let him read this article.

50 in 50 (Richard P. Gabriel and Guy L. Steele) – One of the funniest session I ever seen from the JAOO 2008 convention. This is a brief overview of 50 years of computer science and programming languages – especially the weird and less known languages such as Ook! and Shakespeare.

As well as being hilarious this presentation is also a good resource of the history of computer programming.

And a half

Eternal Flame is used in the 50 in 50 presentation, just to remind us what programming is all about ;)

I was taught assembler
in my second year of school.
It's kinda like construction work —
with a toothpick for a tool.
So when I made my senior year,
I threw my code away,
And learned the way to program
that I still prefer today.


Happy new year

Related Posts Plugin for WordPress, Blogger...