Silverlight 4: System.Xml.Linq.dll is missing?? Well, sort of…

2009-12-10 10:07:19 by Kjell-Åke Gafvelin

I have played around a little with Silverlight 4 the last couple of days and I was consuming a REST service but when I wanted to use XLinq for querying the response I couldn’t find it in the References dialog.


And when I searched on the internet for a solution to this I found out that many others had the same experience. But they solved it by copying the System.Xml.Linq.dll assembly from the Silverlight SDK to the Reference Assemblies folder.

The reason for the absence of System.Xml.Linq.dll in Silverlight 4 is actually that the Silverlight team wanted to keep the Silverlight 4 runtime as small as possible (~4 Mb) even though they added more functionality that in Silverlight 3. What they did then was that they removed assemblies that can be seen as “luxury” to have in the runtime and put them into the SDK instead so that if you want use XLinq have to distribute it within your own .XAP-file.