Saturday, February 19, 2011

Quick tip: Linking against appropriate assembly depending on your configuration in VS.NET

Occasionally, while developing a .NET app, I've needed to reference an assembly from another solution from within my current one. Most often I see projects referencing either the debug or release versions directly, but what happens if you want to reference an assembly for the same configuration that your current solution is in? (i.e. referencing an external debug mode assembly while you're in debug mode and a release mode assembly in release mode)

The answer is an easy one, but can't be done directly by the IDE.

Reference the debug version of the  assembly you want to as per normal.

Next right click the project, which you just added the assembly to, and select edit project file. This will bring up the project's msbuild file.

Find the reference to the assembly you just added and replace the text Debug in the HintPath with $(Configuration)

Save and close the project file then reload the project. That's it! Now when you compile in debug or release mode the correct version of the referenced assembly will be compiled too.

NB: this assumes the dependant assemblies are located in Debug and Release folders off of the same parent folder.

Wednesday, February 16, 2011

Microsoft Nokia deal observations from a consumer

I don't profess to be an expert on the mobile industry but I thought I'd post my thoughts on the recent Nokia/Microsoft partnership from a consumers perspective.

Though it seems that Nokia employees and shareholders are unhappy and their stock took a nose dive, I see the switch away from Symbian to be a positive one.

I used to insist on using only Nokia phones from when I got my first one in 97 until around 2003. I not only used their phones but also one of the early smartphones, the Nokia 9110 communicator.

My love of Nokia phones started dwindling when I first moved to the US from the UK in 2001. To say that it was all Nokia's or Symbian's fault would be unfair, some of the issues lay with the state of the US mobile industry. Having to switch from a GSM to a CDMA network didn't help things.

I was disappointed with the phones available for one. They all seemed antiquated compared with the new Nokia phones that had started to come out back home. I felt like I'd stepped back in time.

From a business perspective I can understand why they wouldn't want to invest money in a non-mainstream technology. Still as a consumer I didn't care about that.

In 2003 I switched over to a Samsung phone as they had better options available for the free or cheaper phones. I did have a Nokia again when my Samsung broke and the local Cingular store no longer had one as an option. Unfortunately I didn't find that my new phone was much removed from phones that I'd used years before.

As soon as I got my Blackberry, Nokia phones became completely irrelevant as there wasn't anything available to me that came anywhere near, I.E. offering a phone that could integrate with Exchange for email and calendar, give me a half decent web browser (admittedly I moved to opera mini from blackberry's native one).

After moving back to the UK at the end of last year I needed a new phone. I didn't even consider a Nokia as an option and frankly didn't look. It was between an iPhone or an Android based phone.  I ended up getting a HTC Desire which runs Android (which I greatly prefer to my work iPhone 3Gs).

Looking back at this, most of my disappointment has been with the evolution (or in my view regression) of Symbian as an operating system. Rather than the quality of the hardware which has always been good.

To sum up, the Nokia/Microsoft partnership is a good thing in my point of view. Nokia get a good mobile operating system to replace Symbian and can break with that legacy. It also means that we only have 4 platforms that we need to develop for.

I don't know if this will be enough to save Nokia, but its a step in the right direction.

Would I look at a Nokia smartphone in the future?  My answer is yes I'd be prepared to give them another shot.