This is documentation for Mathematica 5, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.2)

Documentation / Mathematica / Add-ons & Links / .NET/Link /

Install the NETLink directory into your AddOns directory

.NET/Link is already installed in Mathematica 5.0 and later. If you downloaded .NET/Link to install into Mathematica 4.x, place the NETLink directory into your <Mathematica dir>\AddOns directory. If you downloaded an update to .NET/Link, replace the existing <Mathematica dir>\AddOns\NETLink directory with the new one. Users should check the .NET/Link home page for a pending update to .NET/Link that greatly increases the size of this User Guide. It may already be available by the time you read this.

You also need to be sure that you have J/Link 2.1 or later, which first became available in June 2003 and shipped with Mathematica 5.0. Although .NET/Link does not use Java in any way, it shares some Mathematica code with J/Link. You can get the latest J/Link from the J/Link home page.

Get the .NET Framework

You also need the Microsoft .NET Framework installed. .NET/Link will work with Version 1.0 or 1.1 of the .NET Framework. The easiest way to install the .NET Framework, if you do not already have it, is to get it from the Windows Update website. One way to check to see if it is installed is to look for an assembly directory in your Windows directory. The following line will return True if you have the .NET Framework installed.

(FileType /. FileInformation[ToFileName[Environment["WINDIR"], "assembly"]]) === Directory

Install the .NET/Link assembly into the Global Assembly Cache

If you are going to be writing .NET programs that call Mathematica, as described in Part 2 of this User Guide, you will find it convenient to have the .NET/Link assembly file installed into the special .NET directory called the Global Assembly Cache (GAC).The Mathematica 5.0 installer puts a copy of the .NET/Link assembly into the GAC if the .NET Framework exists on your machine at the time the installer is run. If you installed .NET after Mathematica 5.0, have downloaded .NET/Link for use with Mathematica 4.x, or have downloaded an update to .NET/Link that you are installing manually, you will probably want to put the .NET/Link assembly into the GAC yourself. The .NET/Link assembly file is named Wolfram.NETLink.dll, and you will find it in the <Mathematica dir>\AddOns\NETLink directory. To put it into the GAC, drag and drop it into the c:\Windows\assembly directory (c:\WinNT\assembly on some versions of Windows). You must do this by dragging and dropping--you cannot use an operating system Copy command or Mathematica's CopyFile function (if this was possible, we would have done it for you already).