inst/HiGHS/docs/src/interfaces/csharp.md

CSharp

Build from source

There is a C# example code in examples/call_highs_from_csharp.cs. From the HiGHS root directory, run

cmake -S. -Bbuild -DCSHARP=ON

If a CSharp compiler is available, this builds the example using cmake and generates a binary in the build directory (build/bin/csharpexample).

NuGet

The nuget package Highs.Native is on https://www.nuget.org, at https://www.nuget.org/packages/Highs.Native/.

It can be added to your C# project with dotnet

dotnet add package Highs.Native --version 1.9.0

The nuget package contains runtime libraries for

Details for building locally can be found in nuget/README.md.

C# API

The C# API can be called directly. Here are observations on calling the HiGHS C# API from C#:

This is the normal way to call plain old C from C# with the great simplification that you don't have to write the PInvoke declarations yourself.



Try the highs package in your browser

Any scripts or data that you put into this service are public.

highs documentation built on April 4, 2025, 3:23 a.m.