Error while adding Windows DLL to Silverlight

I guess, this month is really buggy for me. Encountered a lot of errors and bugs during the development and my recent posts reflects the same. Because, I’m pushed through a lot of new Technologies during these days. It’s not that lot of new technologies are released during these days. But, the fact is - I’m a late adopter of Technology.

This time, I’s integrating a Silverlight Application into an existing 3-tier architecture project. Since, the idea of layer reuse exists, I used the same layers for building the Silverlight Application. The business later for my project is a Windows DLL and I referred the DLL into my Silverlight application for making reusing of layer practical.

Bhoom!!! I’s shocked with an error:

You can only add project references to other Silverlight project in the solution.


Upon close investigation, its clear that the CLR for both desktop and Silverlight uses 2 different engine. And that is the reason, why I cannot refer my Windows DLL into the Silverlight application.

Here you have 2 options:

  1. Use a Silverlight Class Library
  2. Use WCF Service.

I’ll ask you to go with WCF.

And please note. not every Windows namespaces are available in Silverlight, say you won’t get System.Data namespace and few others. This is done to keep the Silverlight plugin as simple and light-weight as possible. Might there be any future enhancements. But as of now, not everything that is available in Windows DLL is not available in Silverlight. So before you jump on to Silverlight and start developing the Rich application, please please please take care of the available data retrieval options.

Hope this helps.

Thanks and Merry X’Mas.

Suspicious Account Access warning in Facebook

Shocked! Screamed! Unconscious!

This’s the first thing I saw when I tried to Login to my Facebook Account – A Suspicious Account Access warning message. Someone hacked/accessed my Facebook account from Los Angels.

Here is the screenshot:

FB_Suspicious Activity - Trim

I hate intruders! Again and again, Facebook is proving to be a brittle and less-secure platform.


WCF - Could not load type 'System.ServiceModel.Activation.HttpModule' from assembly 'System.ServiceModel, Version=’

That was a surprise, when I run my first WCF application in .NET 4.0. I’s blown with an error:

Could not load type 'System.ServiceModel.Activation.HttpModule' from assembly 'System.ServiceModel, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089'.

Have you noticed the error message where the System.ServiceModel has version 3.0. Yup, That’s it!

This error can occur in 2 scenarios:

  1. IIS is installed after installing .NET Framework 4.0
  2. Version 3.0 of WCF Http Activation Module is installed after installing IIS and .NET Framework 4.0

However, this can be easily solved by registering the correct version of ASP.NET. So, fire up your Visual Studio 2010 Command Prompt or browse to "C:\Windows\Microsoft.NET\Framework\ v4.0.30319". And run the following command from the command prompt:

aspnet_regiis.exe -iru

Happy Servicing!