Where is my System.Numerics namespace?

Kevin picture Kevin · Jan 27, 2011 · Viewed 28.3k times · Source

I'm using Visual Studio 2010 and trying to use the BigInteger type in a C# program. This type is supposed to be available in System.Numerics namespace, but I don't seem to have that installed in the .Net 4.0 framework. When I type "using System.Numerics;" in VS2010, a red underline appears under the "Numerics". Has anyone else ever had this problem?

If so, how do you resolve it? I just re-downloaded and re-installed (repaired) the .Net 4.0 framework, but that didn't help. I've never had any problems with other C# programs that I've written, so I'm wondering what I'm missing.

Answer

CodesInChaos picture CodesInChaos · Jan 27, 2011

You need to add an assembly reference to System.Numerics.dll

The MSDN entry on BigInteger states:

BigInteger Structure
...
Namespace: System.Numerics
Assembly: System.Numerics (in System.Numerics.dll)