Gustavo Guerra
Gustavo Guerra

Reputation: 5359

System.Xml.Linq, Portable Libraries and Silverlight

I built a portable class library (profile47, which includes Silverlight 5) that references System.Xml.Linq. I can reference that portable library from my Silverlight 5 application, and I can reference the Silverlight version of System.Xml.Linq in C:\Program Files (x86)\Microsoft SDKs\Silverlight\v5.0\Libraries\Client. The problem is that that System.Xml.Linq dll has a different version number (5.0.5.0) than the one referenced by the portable library, and when I run the Silverlight app it throws an exception:

Could not load file or assembly 'System.Xml.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies. The system cannot find the file specified.

As there isn't an assembly redirect mechanism in app.config like in full .NET framework, is there any way to make this work?

Upvotes: 1

Views: 1567

Answers (1)

pauldendulk
pauldendulk

Reputation: 1598

Remove the System.Xml.Linq reference from your portable class library. The .Net Portable Subset is enough if you have .net framework 4.0.3 in your profile.

Upvotes: 2

Related Questions