Please do not ever download system files from some arbitrary website and try to use them. This is generally just asking for malware to be added to your system. If you downloaded System.Numerics
from some website then remove all references to it from your filesystem and then run a virus scan to ensure you didn't infect your computer.
System.Numerics
is not supported by NET 3.5 so you cannot use it. It doesn't matter whether you copy files or not, it won't work. You need to target at least .NET v4. For .NET 4 you need to use at least .NET 4.6.2 as this is the earliest version that is still supported as discussed here. However if you are running Windows 10 or 11 then go ahead and target .NET 4.7.2 or higher as it ships with the OS. In general you do not need to install NET Framework as it is already installed by the OS. Which version you have depends on the version of the OS you are running.
VS 2008 is not supported anymore and doesn't support NET 4 anyway. Therefore you cannot use the System.Numerics
assembly with VS 2008. VS 2022 Community edition is freely available so you should go ahead and install it instead. It'll support .NET 4 and all newer versions, that are still in support. However you may run into an issue trying to open an older VS 2008 project in the newer VS edition. You may have to recreate your project(s).
The changes between NET 3.x and NET 4 are huge. You will not be able to simply recompile your code to get it to work. The configuration settings and overall behavior are different. Your best bet is to create a new project with NET 4.x in VS 2022 and then copy over your legacy code piece by piece to rebuild your functionality. Be especially careful with any config file stuff as the NET 3.x configuration file won't work with NET 4.x. There are lots of articles online on how to do this.
Once you have your project loaded in VS 2022 with NET 4.x then you are reading to add support for numerics. In VB an Import
statement doesn't control what assemblies are referenced (see here). It specifies what namespaces (a coding thing) are available to the current source file. Each source file must specific what namespace(s) it will use. The Import
statement does that. In order for you to import a namespace you must have a reference, in your project, to an assembly that contains something in that namespace.
To add a reference to an assembly in your project, so you can import the namespace, go to the References node in Solution Explorer (or project properties if yo uprefer) and add an assembly reference to System.Numerics
. It is already installed on your machine, just add an assembly reference to it (VS will show you the only one that is available to you). Then the namespace will be available and your Import
, in the source file, will bring into scope the types available in that namespace.