.NET/Link API Version 1.7

.NET/Link Overview

.NET/Link is a toolkit that integrates the Wolfram Language and .NET. It allows you to call .NET from the Wolfram Language and call the Wolfram Language from .NET.


Calling .NET From the Wolfram Language

.NET/Link allows Wolfram Language programmers to load arbitrary .NET types into the Wolfram Language, create objects of these types, call methods and properties, and so on. You can, in effect, "script" .NET from the Wolfram Language. This powerful capability literally makes all of .NET accessible directly from the Wolfram Language and allows exciting new categories of Wolfram Language programs to be created, incuding creating user interfaces, controlling COM objects like Microsoft Office, interacting directly with the Windows operating system, and many others.

Calling .NET from the Wolfram Language is documented in Part 1 of the .NET/Link User Guide. The help file you are currently reading will not be of much value, as it describes the .NET/Link API as seen by .NET programmers, not Wolfram Language programmers. It can still be useful for Wolfram Language programmers who want to use one of the .NET/Link classes that are designed to be used from the Wolfram Language, such as the MathPictureBox class.


Calling the Wolfram Language from .NET

.NET/Link allows programmers writing in any .NET language, such as C# or Visual Basic .NET, to launch the Wolfram System and use it as a computational engine. This help file describes the .NET/Link API that .NET programmers will use to interact with the Wolfram Language.

A good place to start is the IKernelLink interface. You will find a simple example program there. IKernelLink is the link interface that most programmers will use.

You should also look at the MathKernel class. This component provides a very high-level interface for interacting with the Wolfram Language. It is especially intended for use in visual programming environments, as it is highly configurable via properties. It is especially useful for programs that want to capture not just the result of a computation, but also messages, Print output, or graphics generated as side effects of the computation.

There are example programs in the .NET/Link examples directory: <Wolfram dir>\SystemFiles\Links\NETLink\Examples\Part2.

There is more documentation for .NET programmers in the .NET/Link User Guide. Part 2 of the User Guide describes writing .NET programs that call the Wolfram Language, and it treats various topics in .NET/Link programming. The present help file is the API-level documentation.

.NET/Link consists of a single assembly, Wolfram.NETLink.dll. The Wolfram System installer creates a special registry key that allows the Wolfram.NETLink assembly to automatically appear in the Visual Studio "Add Reference" dialog.