NETLink`
NETLink`

InstallNET

InstallNET[]

launches the .NET runtime and prepares it to be used from the Wolfram Language.

InstallNET[link]

configures .NET/Link to use a manually created link to a .NET runtime.

Details and Options

  • To use InstallNET, you first need to load .NET/Link using Needs["NETLink`"].
  • Only one .NET runtime is ever launched; subsequent calls to InstallNET after the first have no effect.
  • InstallNET works on all platforms, but on Macintosh and Linux systems you need to have either Mono or the .NET runtime installed.
  • The following options can be given:
  • "UseNETFramework"Automaticwhether to use the .NET Framework (4.x) or the newer .NET 6 and later
    "MonoPath"Automaticcustom path to the Mono runtime, if installed in a nonstandard location
    "DotnetPath"Automaticcustom path to the dotnet runtime, if installed in a nonstandard location
    "Force32Bit"Falsewhether to run in 32-bit mode (only supported on Windows)
  • On Windows, the default value of "UseNETFramework"->Automatic will choose the older .NET Framework (version 4.x). Specify "UseNETFramework"->False to launch the modern .NET runtime (.NET 6 and later) instead.
  • On Macintosh, the default value of "UseNETFramework"->Automatic will choose the modern .NET runtime (.NET 6 and later). Specify "UseNETFramework"->True to launch Mono (which is the .NET Framework).
  • On Linux, the default value of "UseNETFramework"->Automatic will launch Mono (which is the .NET Framework). Use "UseNETFramework"->False to the modern .NET runtime (.NET 6 and later).

Examples

open allclose all

Basic Examples  (1)

Load the .NET/Link package:

Launch the .NET runtime and prepare it for use:

Create a .NET object:

Call a method on the object:

Properties & Relations  (1)

Call ReinstallNET if you want to force the .NET runtime to restart, such as with different options:

Restart the .NET runtime with a different option: