Skip to content

.NET 8 Upgrade#

The ATLAS client (11.4.4.349-W47) and SQL RACE (2.1.25308.1-ci) is now updated to .NET 8.

Users will need to consider upgrading any custom plugins or scripts they might have written to this framework.

Provided the custom ATLAS plugin does not use any .NET libraries that are no longer supported in .NET 8, they should still work with this release of ATLAS, but this is not something we can guarantee. You may find it necessary to recompile against .NET 8.

C##

You may wish to determine any initial portability concerns using the Platform Compatibility Analyzer and .NET Portability Analyzer. For C# there is also the .NET Upgrade Assistant to upgrade projects, this will:

  • Upgrade to new project format
  • Replace old style packages.config with project file-based package references
  • Update dependencies as required to support at least .NET Standard

There might be instances when certain dependencies may have to be updated/replaced, e.g. if it is no longer supported in .NET 8. Useful sites:

Porting Guides#

https://docs.microsoft.com/en-us/dotnet/core/porting/

https://docs.microsoft.com/en-gb/dotnet/core/porting/net-framework-tech-unavailable

https://docs.microsoft.com/en-us/dotnet/standard/library-guidance/cross-platform-targeting

https://learn.microsoft.com/en-us/dotnet/desktop/wpf/migration/

.NET Upgrade Assistant#

https://docs.microsoft.com/en-us/dotnet/core/porting/upgrade-assistant-overview

.NET Portability Analyzer#

https://docs.microsoft.com/en-us/dotnet/standard/analyzers/portability-analyzer

Platform Compatibility Analyzer#

https://docs.microsoft.com/en-us/dotnet/standard/analyzers/platform-compat-analyzer

MATLAB#

For compatibility with .NET 8, you will need to run MATLAB R2023a or higher as this will support .NET 6 or higher.

Targeting a Specific .NET Version#

MATLAB R2025a or newer#

For MATLAB R2025a or newer, you can target a specific .NET Core version and specify required frameworks directly when initializing the environment. This is especially important if your code or dependencies require assemblies such as Microsoft.Extensions.Caching.Memory, which is included in Microsoft.AspNetCore.App.

Example:

ne = dotnetenv("core", Version="8", Frameworks="Microsoft.AspNetCore.App");
You can also define multiple frameworks if needed:
ne = dotnetenv("core", Version="8", Frameworks=["Microsoft.AspNetCore.App", "Microsoft.NETCore.App"]);

MATLAB R2024b and older#

MATLAB versions earlier than R2023a do not support the .NET 8 runtime.

The default .NET runtime for MATLAB R2023a+ can be configured to .NET Core with the following command:

dotnetenv('core')

If you have newer .NET runtime environments (> .NET 8) then it is advised to state the version explicitly:

dotnetenv("core", Version="8");

Known Issues and Patches#

MATLAB R2024b with .NET 8

MATLAB R2024b may have issues loading the .NET 8 runtime. If you experience problems, verify the ijwhost.dll in <matlabroot>/bin/win64 is compatible with .NET 8.

From a .NET 8 installation, copy ijwhost.dll from ./packs/Microsoft.NETCore.App.Host.win-x64/8.0.XX/runtimes/win-x64/native/ijwhost.dll into <matlabroot>/bin/win64 (replace existing).

Runtime Configuration#

The runtime configuration file for the .NET runtime can be found in matlabroot/bin/win64/dotnetcli_netcore.runtimeconfig.json. With this file, MATLAB loads the latest appropriate assemblies compatible with SQLRace API.

An example configuration for the runtime is provided below.

{
  "runtimeOptions": {
    "rollForward": "Minor",
    "tfm": "net8.0",
    "frameworks": [
      {
        "name": "Microsoft.NETCore.App",
        "version": "8.0.0"
      },
      {
        "name": "Microsoft.WindowsDesktop.App",
        "version": "8.0.0"
      },
      {
        "name": "Microsoft.AspNetCore.App",
        "version": "8.0.0"
      }
    ],
    "configProperties": {
      "System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization": true
    }
  }
}

More information about calling .NET from MATLAB can be found in the MATLAB documentation.

Hint

Information on the runtime in use can be retrieved using:

e = dotnetenv;
disp(e)

Python#

In order to run .NET in Python you need to use pythonnet, currently this only supports python 3.7 - 3.13 with 3.14 and newer not yet supported.

The runtime must be configured before clr is imported, otherwise the default runtime will be initialized and used.

The .NET Core runtime can be loaded in code by calling pythonnet.load or configuring the environment variable.

In Code

from pythonnet import load

load("coreclr", runtime_config=r"C:\Program Files\McLaren Applied Technologies\ATLAS 10\MAT.Atlas.Host.runtimeconfig.json")

Environment Variable

PYTHONNET_RUNTIME=coreclr
PYTHONNET_CORECLR_RUNTIME_CONFIG=C:\Program Files\McLaren Applied Technologies\ATLAS 10\MAT.Atlas.Host.runtimeconfig.json

More information about calling .NET from Python can be found in the pythonnet documentation.

Hint

Information on the runtime in use can be retrieved using pythonnet.get_runtime_info().