This project has moved and is read-only. For the latest updates, please go here.

Silverlight 5 System.Numerics.Complex conflict with System.Numerics.dll

Mar 23, 2013 at 6:46 PM
Edited Mar 23, 2013 at 6:53 PM

I have a Silverlight 5 project that uses the Math.Net numerics library. Upon updating my references and adding the library via NuGet, I'm having a problem compiling the project.

It seems that the library MathNet.Numerics.dll (v2.4.0) has a definition for System.Numerics.Complex, which is conflicting with System.Numerics.Complex in the SL5 client library, System.Numerics.dll. The full error I see is:

The type 'System.Numerics.Complex' exists in both '...\myproject\src\packages\MathNet.Numerics.2.4.0\lib\portable-net40+windows8+wp8+sl5\MathNet.Numerics.dll' and 'c:\Program Files (x86)\Microsoft SDKs\Silverlight\v5.0\Libraries\Client\System.Numerics.dll'

Do you have any guidance on how to deal with this? Are external aliases the only route?

Thanks in advance,
Mar 23, 2013 at 9:56 PM
So, I figured out that (for my case at least), I could remove the reference to System.Numerics.dll and can get everything to compile. Is there any documentation on the System.Numerics implementation with MathNet.Numerics.dll?
Apr 4, 2013 at 6:18 PM
Edited Apr 4, 2013 at 6:18 PM
Indeed, maybe our approach to replace/backport missing pieces (the portable library profile we use is quite limited) in their original place was not such a good idea after all.