The type or namespace name ‘DataContractJsonSerializer’ could not be found (are you missing a using directive or an assembly reference?)

When I try to upgrade my application, which I created from Silverlight2 to Silverlight4.
I have received the following error.

The type or namespace name ‘DataContractJsonSerializer’ could not be found (are you missing a using directive or an assembly reference?)
I have spent ages, try to figure out which assembly refernce I have missed in order to get it work.
E.g. I have checked that I have got the following reference added to the application.
System.Runtime.Serialization;
System.Runtime.Serialization.Json;

Finally, I remembered which reference I am missing.

Here it is the assembly reference you need to import, when you receive error message about
The type or namespace name ‘DataContractJsonSerializer’ could not be found (are you missing a using directive or an assembly reference?)
System.ServiceModel.Web

1) Right click on your “Project” and select “Add Reference…
2) On the “.Net” tab
3) Select “System.ServiceModel.Web” and Click “OK

This error should be fixed.

Hope you find it useful.

3 thoughts on “The type or namespace name ‘DataContractJsonSerializer’ could not be found (are you missing a using directive or an assembly reference?)

Leave a Reply