Main Content

MATLAB Compiler SDK .NET Target Requirements

System and Product Requirements

System Dependencies

.NET applications with packaged MATLAB® code can be developed and published across Windows®, Linux®, and macOS platforms. This means it's possible to develop on any one of these platforms and publish to any of the other two. (since R2023a)

Before R2023a: Generating .NET assemblies using MATLAB Compiler SDK™ is supported on Windows systems only.

Product Dependencies

The following products must be installed alongside MATLAB Compiler SDK:

  • MATLAB

  • MATLAB Compiler™

.NET assemblies developed using MATLAB Compiler SDK and integrated with .NET applications require MATLAB Runtime during execution. For details, see Download and Install MATLAB Runtime.

Supported Microsoft .NET Versions

  • Microsoft® .NET Framework 4.6.2 or higher

  • Microsoft .NET 6.01 or higher

  • Before R2023b: Microsoft .NET Core 2.0 or higher and .NET 5.02

For an up-to-date list of .NET versions supported by MATLAB Compiler SDK, see https://www.mathworks.com/support/compilers/current_release/.

You can download and install .NET SDK from https://dotnet.microsoft.com/download.

Caution

According to Microsoft, .NET Framework 4.8 is the last recommended version of .NET Framework. For new .NET development, Microsoft recommends using more recent versions of .NET such as .NET 6.0 or higher.

Data API

MathWorks® provides two data APIs for handling data exchange between a .NET application and deployed MATLAB code:

  • MWArray API that works with .NET Framework 4.0 or higher and .NET 6.0 or higher.

  • MATLAB Data API for .NET that works with .NET 6.0 or higher and .NET Framework (with Limitations). For details, see Compatibility.

These data APIs are installed on your system when you install MATLAB and MATLAB Compiler SDK or MATLAB Runtime. For assembly reference locations associated with these data APIs, see Set Up .NET Development Environment.

MATLAB Data API for .NET is shared between MATLAB Compiler SDK and MATLAB Engine. For details, see Call MATLAB from .NET.

Compatibility

 MWArray APIMATLAB Data API for .NET
.NET Compatibility

  • .NET 6.0 or higher (recommended) (see Limitations below)

  • .NET Framework 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8 (see Limitations below)

  • .NET 6.0 or higher (recommended)

  • .NET Framework 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8 (see Limitations below)

Products

MATLAB Compiler SDK

  • MATLAB Compiler SDK

  • MATLAB Engine in MATLAB

Cross-Platform

  • .NET Framework

    • Windows only for assembly generation and integration with .NET apps.

  • .NET 6.0 or higher

    • Windows only for assembly generation.

    • Windows, Linux and macOS for integration with .NET apps.

Windows, Linux, and macOS for both assembly generation and integration.

Limitations (.NET Framework)

  • Deployed applications that integrate assembles generated using .NET Framework can run only on Windows systems.

  • .NET Framework does not have a command-line interface for development. For example, you cannot execute dotnet new or dotnet build from the command-line.

  • Deployed applications that integrate assembles generated using .NET Framework can run only on Windows systems.

  • .NET Framework does not have a command-line interface for development. For example, you cannot execute dotnet new or dotnet build from the command-line.

Limitations (.NET 6.0 or higher)

.NET assembly generation is exclusively supported on Windows systems. However, integration with .NET applications can be accomplished on Linux and macOS systems.

 
Other Remarks MathWorks recommends using MATLAB Data API for .NET for deployment across the broadest array of platforms.

MathWorks recommends using the MATLAB Data API for .NET with .NET 6.0 or later, rather than the .NET Framework, in alignment with Microsoft's suggestion that .NET Framework 4.8 is the final version to be endorsed. Embracing .NET 6.0 or later not only aligns with Microsoft's forward-looking strategy, but also fully unlocks the cross-platform development potential of MATLAB Data API for .NET, covering both assembly generation and integration.

In addition, when you use the MATLAB Data API for .NET, a MATLAB Runtime instance can run either in-process or out-of-process with respect to the .NET application, and deployed MATLAB functions can be executed either synchronously or asynchronously. Also, the API is thread-safe which facilitates concurrent data creation and consumption across multiple threads without the need for locking. This leads to improved performance, particularly when there's extensive manipulation of MATLAB data in multiple threads. For details on which API to choose, see Choose .NET Deployment Option

Cross-Platform Support

.NET VersionDevelop onPublish toRequirementsAvailability (Since Release)Support Status
.NET 6.0 or higher

Windows, Linux, and macOS

Windows, Linux, and macOS

.NET 6.0 or higher installed

R2023a

Supported

.NET 5.0

Windows

Windows, Linux and macOS

.NET 5.0 installed

R2022a

Not supported as of R2023b

.NET Core 2.0 or higher

Windows

Windows, Linux and macOS

.NET Core 2.0 or higher installed

R2019b

Not supported as of R2023b

Note

Cross-platform assembly generation and integration require .NET 6.0 or higher, previously achievable with .NET 5.0 or .NET Core.

Development Environment

For details on how to set up your .NET development environment for integrating packaged MATLAB code, see Set Up .NET Development Environment.

MATLAB Compiler SDK .NET Limitations

  • Serializing MATLAB objects from MATLAB into .NET code is unsupported.

Related Topics


1 If you use Visual Studio® 2022 (v17.0 or higher) for your .NET development needs, .NET 6.0 SDK is included as part of the installation.

2 Starting in R2023b, .NET Core (all versions) and .NET 5.0 are no longer supported.